Compiling the following invalid ocde snippet I get an ICE: ============================== template<int> enum E { e }; ============================== bug.cc:1: error: template declaration of 'enum E' bug.cc:1: internal compiler error: tree check: expected class 'declaration', have 'exceptional' (error_mark) in pushdecl, at cp/name-lookup.c:641 Please submit a full bug report, [etc.] The regression appeared with Kriang's patch http://gcc.gnu.org/ml/gcc-cvs/2003-10/msg00781.html Looks like some function cannot deal with the returned error_mark_node in push_template_decl_real.
Confirmed.
: Search converges between 2003-10-20-trunk (#382) and 2003-10-23-trunk (#383).
Will look at it.
Postponed until GCC 3.4.4.
Patch submitted: http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00194.html
Old patch retracted, new patch in progress.
Revised patch posted: http://gcc.gnu.org/ml/gcc-patches/2004-11/msg00890.html
Subject: Bug 18123 CVSROOT: /cvs/gcc Module name: gcc Changes by: lerdsuwa@gcc.gnu.org 2004-12-02 11:34:57 Modified files: gcc/cp : ChangeLog parser.c gcc/testsuite : ChangeLog gcc/testsuite/g++.old-deja/g++.pt: enum5.C Added files: gcc/testsuite/g++.dg/parse: enum2.C Log message: PR c++/18123 * parser.c (cp_parser_type_specifier): Catch template declaration of enum. * g++.dg/parse/enum2.C: New test. * g++.old-deja/g++.pt/enum5.C: Adjust error location. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4509&r2=1.4510 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.286&r2=1.287 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4705&r2=1.4706 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/enum2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.old-deja/g++.pt/enum5.C.diff?cvsroot=gcc&r1=1.5&r2=1.6
Subject: Bug 18123 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: lerdsuwa@gcc.gnu.org 2004-12-02 11:51:33 Modified files: gcc/cp : ChangeLog parser.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/parse: enum2.C Log message: PR c++/18123 * parser.c (cp_parser_type_specifier): Don't create new enum type if it is not in the form 'enum [identifier] { [...] };'. Catch template declaration of enum. * g++.dg/parse/enum2.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.180&r2=1.3892.2.181 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.157.2.45&r2=1.157.2.46 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.316&r2=1.3389.2.317 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/enum2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
Fixed in 3.4 branch and mainline.