[Bug c++/59044] New: Internal compiler error triggers when accessing a typedef in a specialized member class
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59044 Bug ID: 59044 Summary: Internal compiler error triggers when accessing a typedef in a specialized member class Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: decaluwe.t at gmail dot com Created attachment 31180 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31180&action=edit Preprocessor output The following code triggers an internal compiler error when compiled with 'g++ bug.cpp' (the complete preprocessed file can be found in the attachment): /* bug.cpp --- */ template class C { private: template struct Implementation; template struct Implementation<0, b> { typedef void Typedef; }; public: typedef typename Implementation<0, 0>::Typedef Type; }; template class C; /* */ The error message produced by g++ 4.8.1 (as found in the g++-4.8 package in the Ubuntu 13.10 repo, see below for build information): bug.cpp: In instantiation of ‘class C’: bug.cpp:12:16: required from here bug.cpp:9:52: internal compiler error: in tsubst, at cp/pt.c:11313 typedef typename Implementation<0, 0>::Typedef Type; ^ This bug is still present in the gcc-snapshot package. However the code compiles fine in g++ 4.7.3 (as found in the g++-4.7 package). Additional information: GCC version: gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu8) System type: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.8.1-10ubuntu8' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
[Bug c++/59044] [4.8/4.9 Regression] Internal compiler error triggers when accessing a typedef in a specialized member class
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59044 --- Comment #2 from Tom De Caluwé --- As far as I can verify partial specializations are only allowed at namespace scope so you're right. However gcc never used to complain about such constructs. In any case, an internal compiler error is never desired behaviour, hence the bug report.
[Bug c++/59044] [4.8/4.9 Regression] Internal compiler error triggers when accessing a typedef in a specialized member class
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59044 --- Comment #4 from Tom De Caluwé --- However the following code seems to be valid but results in the same ICE: /* bug.cpp --- */ namespace N { template class C { private: template struct Implementation {}; public: typedef typename Implementation<0, 0>::Typedef Type; }; template template struct C::Implementation<0, b> { typedef void Typedef; }; } template class N::C; /* */
[Bug c++/59052] New: Partial specialization of template with dependent non-type template argument not correctly resolved
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59052 Bug ID: 59052 Summary: Partial specialization of template with dependent non-type template argument not correctly resolved Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: decaluwe.t at gmail dot com Created attachment 31183 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31183&action=edit The preprocessed code This bug seems to be related to bug 59044 (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59044). The following code when compiled with 'g++ spec.cpp' is rejected by gcc 4.8.1: /* spec.cpp */ namespace N { template struct C { template struct Implementation {}; }; template template struct C::Implementation { static void method() {} }; } int main() { N::C::Implementation::method(); } /* */ The bug is only triggered when the second template argument is a non-type template argument dependent on the template argument of the enclosing class template. The error message produced by g++ 4.8.1 (as found in the g++-4.8 package in the Ubuntu 13.10 repo, see below for build information): spec.cpp: In function ‘int main()’: spec.cpp:18:5: error: ‘method’ is not a member of ‘N::C::Implementation’ N::C::Implementation::method(); ^ This bug is still present in the gcc-snapshot package. However the code compiles fine in g++ 4.7.3 (as found in the g++-4.7 package). Additional information: GCC version: gcc version 4.8.1 (Ubuntu/Linaro 4.8.1-10ubuntu8) System type: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.8.1-10ubuntu8' --with-bugurl=file:///usr/share/doc/gcc-4.8/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.8 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.8-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.8-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
[Bug c++/59044] [4.8/4.9 Regression] Internal compiler error triggers when accessing a typedef in a specialized member class
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59044 --- Comment #6 from Tom De Caluwé --- I reported a related bug with valid code which does not trigger this ICE (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59052). Also LLVM bug 16519 (http://llvm.org/bugs/show_bug.cgi?id=16519) might be related to the errors triggered by clang when compiling the example code above. The example code provided in bug 59052 does compile with clang.
[Bug c++/59364] C++11 extern thread_local breaks linking: undefined reference to TLS init function
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59364 Tom De Caluwé changed: What|Removed |Added CC||decaluwe.t at gmail dot com --- Comment #1 from Tom De Caluwé --- This seems to be a duplicate of bug #55800. The workaround mentioned in the comments fixes the problem.