Take this (invalid, the "typename" shouldn't be there) piece of code: ------------------- template <typename> class allocator; template<typename T> class vector { typedef typename allocator<T> allocator_type; }; ------------------ g/x> /home/bangerth/bin/gcc-3.2.3/bin/c++ -c x.cc x.cc:4: syntax error before `;' token g/x> /home/bangerth/bin/gcc-3.3*/bin/c++ -c x.cc x.cc:4: error: parse error before `;' token g/x> /home/bangerth/bin/gcc-3.4*/bin/c++ -c x.cc x.cc:4: error: expected nested-name-specifier x.cc:4: error: `allocator<T>' specified as declarator-id x.cc:4: error: two or more data types in declaration of `allocator<T>' x.cc:4: error: expected `;' before "allocator_type" g/x> /home/bangerth/bin/gcc-3.5*/bin/c++ -c x.cc x.cc:4: error: expected nested-name-specifier x.cc:4: internal compiler error: in cp_parser_parse_and_diagnose_invalid_type_name, at cp/parser.c:2268 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. That's a regression. W.
: Search converges between 2004-02-01-trunk (#445) and 2004-03-01-trunk (#446). Most likely the same as PR 14667.
Mine
Subject: Bug 16716 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2004-09-14 00:29:04 Modified files: gcc/testsuite : ChangeLog gcc/cp : ChangeLog parser.c pt.c Added files: gcc/testsuite/g++.dg/parse: crash17.C gcc/testsuite/g++.dg/template: enum3.C Log message: PR c++/16716 * parser.c (cp_parser_parse_and_diagnose_invalid_type_name): Robustify. PR c++/17327 * pt.c (unify): Add ENUMERAL_TYPE case. Replace sorry with gcc_unreacable. PR c++/16716 * g++.dg/parse/crash17.C: New test. PR c++/17327 * g++.dg/template/enum3.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4279&r2=1.4280 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4348&r2=1.4349 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.245&r2=1.246 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.921&r2=1.922 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/crash17.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/enum3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Fixed in GCC 4.0.