This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/50044] Attributes for explicit template instantiation are ignored after an implicit template instantiation occurred.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]