[Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.
ml@convergent-it.at
gcc-bugzilla@gcc.gnu.org
Tue Aug 16 14:18:00 GMT 2011
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
More information about the Gcc-bugs
mailing list