Summary: | [3.3 Regression] ICE in cxx_incomplete_type_diagnostic, at cp/typeck2.c:282 when applying typeid operator to template template parameter | ||
---|---|---|---|
Product: | gcc | Reporter: | Javier Blázquez <blaz> |
Component: | c++ | Assignee: | Mark Mitchell <mark> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | gcc-bugs |
Priority: | P3 | Keywords: | ice-on-invalid-code |
Version: | 3.3.1 | ||
Target Milestone: | 3.3.2 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2003-08-20 14:37:26 |
Description
Javier Blázquez
2003-08-20 11:55:42 UTC
Confirmed with gcc 2.96, 3.2 and 3.3, but already fixed in mainline. The code in question is --------------------------- #include <typeinfo> template <template <class> class T> struct A { void error() { typeid(T).name(); } }; template <class T> struct B {}; template void A<B>::error(); ------------------------------------------- which of course is invalid since T in typeid(T) is not a type but a template. Present mainline gives the following error message: tmp/g> ../build-gcc/gcc-install/bin/c++ -c x.cc x.cc: In member function `void A<T>::error()': x.cc:6: error: missing template arguments W. Actually this is a regression with respect to 2.95.3 so reopening. From 2.95.3, I get: tin:~/src/gnu/gcctest>~/ia32_linux_gcc2_95/bin/gcc pr11991.cc pr11991.cc: In method `void A<B>::error()': pr11991.cc:11: instantiated from here pr11991.cc:5: taking typeid of incomplete type `T' The new parser fixed this regression so maybe this will not be fixed for 3.3.x. This is certainly low priority: it's an ice-on-invalid, and the old error message wasn't quite accurate either. There are certainly more important bugs to be fixed on the release branch. W. Subject: Bug 11991 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: mmitchel@gcc.gnu.org 2003-09-17 23:48:27 Modified files: gcc/cp : ChangeLog call.c class.c cp-tree.h typeck2.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/abi: bitfield11.C bitfield12.C gcc/testsuite/g++.dg/overload: template1.C gcc/testsuite/g++.dg/rtti: typeid3.C Log message: PR c++/11991 * typeck2.c (incomplete_type_diagnostic): Robustify. PR c++/11991 * g++.dg/rtti/typeid3.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.207&r2=1.3076.2.208 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.341.2.32&r2=1.341.2.33 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/class.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.499.2.21&r2=1.499.2.22 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.776.2.33&r2=1.776.2.34 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.132.4.3&r2=1.132.4.4 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.281&r2=1.2261.2.282 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/abi/bitfield11.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/abi/bitfield12.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/overload/template1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/rtti/typeid3.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1 Subject: Bug 11991 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2003-09-17 23:50:05 Modified files: gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/rtti: typeid3.C Log message: PR c++/11991 * g++.dg/rtti/typeid3.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3061&r2=1.3062 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/rtti/typeid3.C.diff?cvsroot=gcc&r1=1.1&r2=1.2 Fixed in GCC 3.3.2. |