http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50044
Martin Lederhilger <m...@convergent-it.at> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|4.5.2 |4.6.1 --- Comment #7 from Martin Lederhilger <m...@convergent-it.at> 2011-08-16 13:17:44 UTC --- I have also tried it with a newer version of gcc, but I receive the same results. Information about the new gcc version is listed below: Using built-in specs. COLLECT_GCC=i686-mingw32-g++ COLLECT_LTO_WRAPPER=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu/libexec/gcc/i686-mingw32/4.6.1/lto-wrapper Target: i686-mingw32 Configured with: ../configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=i686-mingw32 --prefix=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu --with-gmp=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu --with-mpfr=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu --with-mpc=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu --with-ppl=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu --with-cloog=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu --enable-cloog-backend=isl --enable-threads=win32 --enable-tls --enable-languages=c,c++ --with-sysroot=/home/martin/mingw-4.6.1/install-i686-pc-linux-gnu/i686-mingw32 --disable-win32-registry --enable-sjlj-exceptions --disable-libstdcxx-pch --with-host-libstdcxx='-lstdc++ -lsupc++' Thread model: win32 gcc version 4.6.1 (GCC) I think I should use extern template class INTERFACE A<int>; in A.h, and then template class A<int>; to explicitly instantiate it in A.cpp. Is my use of "extern template ..." right - in the meaning that I should specify the attributes there? Does the warning "type attributes ignored after type is already defined" just wants to protect me of having instances of the same type with different attributes in one translation unit (if that is even possible)? In general (not 100 % related to my problem) "extern template ..." would also help me to have the same attributes on the type, if I used it in other translation units as well - I could think that it makes problems (which version should the linker use?) while linking if there are template instantiations with different attributes (I got this enlightenment from bug #38175) - have I understood this correctly? Then since I should probably use "extern template ...", what should I do about the undefined reference to the typeinfo? Could this be related to bug #21243? Thank you, Martin