This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
- From: "ml at convergent-it dot at" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 16 Aug 2011 14:17:32 +0000
- Subject: [Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
- Auto-submitted: auto-generated
- References: <bug-50044-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044
--- Comment #9 from Martin Lederhilger <ml@convergent-it.at> 2011-08-16 14:17:32 UTC ---
Results for:
template<class T>
class INTERFACE A : public Base
...
Case one without "extern template": warning is still there but links fine.
Case two with "extern template": still undefined reference to `typeinfo for
A<int>'
I should note that I cannot use INTERFACE on the class template definition,
because I want to explicitly instantiate the template in multiple DLLs and then
I would need dllimport and dllexport at the same time on the class template
definition. For example instantiate A<int> in A.dll, and A<float> in B.dll:
When I want to use A<int> and A<float> in B.dll then I would need dllimport and
dllexport at the same time. Thats why I want to apply INTERFACE to "extern
template INTERFACE...".
Output from nm for case two (with "extern template...") generated by
i686-mingw32-nm dll.dll | i686-mingw32-c++filt > nm.txt