This is a 4.5.0 regression on invalid code:

========== 8< ==========
template < typename >
struct A
{
A < struct
{
f () :
========== >8 ==========

---------- 4.5.0 ----------
$ x86_64-linux-gnu-g++-trunk -v -c ice-cp_parser_c-342.ii

Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure
--prefix=/opt/software/gcc-x86_64/gcc-trunk --program-suffix=-trunk
--enable-languages=c,c++
Thread model: posix
gcc version 4.5.0 20090410 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-c' '-shared-libgcc' '-mtune=generic'

/opt/software/gcc-x86_64/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/cc1plus
-fpreprocessed ice-cp_parser_c-342.ii -quiet -dumpbase ice-cp_parser_c-342.ii
-mtune=generic -auxbase ice-cp_parser_c-342 -version -o /tmp/ccqQZWYs.s
GNU C++ (GCC) version 4.5.0 20090412 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.5.0 20090410 (experimental), GMP version
4.2.2, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: b13346d60276f3352c4b7dd22e3889d7
ice-cp_parser_c-342.ii:6: error: ISO C++ forbids declaration of ‘f’ with no
type
ice-cp_parser_c-342.ii:6: error: expected ‘}’ at end of input
ice-cp_parser_c-342.ii:6: error: expected template-argument at end of input
ice-cp_parser_c-342.ii:6: error: expected ‘>’ at end of input
ice-cp_parser_c-342.ii:6: error: expected ‘::’ at end of input
ice-cp_parser_c-342.ii:6: error: expected unqualified-id at end of input
ice-cp_parser_c-342.ii:6: error: expected ‘;’ at end of input
ice-cp_parser_c-342.ii:6: error: expected ‘}’ at end of input
ice-cp_parser_c-342.ii:6: internal compiler error: in cp_lexer_new_from_tokens,
at cp/parser.c:342
--------------------

using 4.4.0 or older the compilation terminates with

ice-cp_parser_c-342.ii:6: confused by earlier errors, bailing out


-- 
           Summary: ICE in cp_lexer_new_from_tokens, at cp/parser.c:342
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc at abeckmann dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39751

Reply via email to