[Bug c++/69793] New: g++ ICE on invalid code on x86_64-linux-gnu in "cp_lexer_peek_nth_token"

helloqirun at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Feb 12 23:04:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69793

            Bug ID: 69793
           Summary: g++ ICE on invalid code on x86_64-linux-gnu in
                    "cp_lexer_peek_nth_token"
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: helloqirun at gmail dot com
  Target Milestone: ---

The following invalid code causes an ICE when compiled with the current g++
trunk on x86_64-linux-gnu in both 32-bit and 64-bit modes.

$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20160212 (experimental) [trunk revision 233377] (GCC) 



$ g++-trunk abc.cc
abc.cc:2:12: error: ‘state’ has not been declared
 template < state > bool operator!= (fpos,; operator!=
            ^~~~~
abc.cc:2:42: error: expected identifier before ‘;’ token
 template < state > bool operator!= (fpos,; operator!=
                                          ^
abc.cc:2:42: error: expected ‘)’ before ‘;’ token
abc.cc:2:52: internal compiler error: in cp_lexer_peek_nth_token, at
cp/parser.c:1055
 template < state > bool operator!= (fpos,; operator!=
                                                    ^~
0x7249d2 cp_lexer_peek_nth_token
        ../../gcc/gcc/cp/parser.c:1055
0x7478af cp_parser_template_id
        ../../gcc/gcc/cp/parser.c:14829
0x748e9a cp_parser_type_name
        ../../gcc/gcc/cp/parser.c:16364
0x737451 cp_parser_type_name
        ../../gcc/gcc/cp/parser.c:16335
0x737451 cp_parser_simple_type_specifier
        ../../gcc/gcc/cp/parser.c:16249
0x7334ad cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:15902
0x7486e1 cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:12745
0x755b31 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:12288
0x755f7a cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:12235
0x75ecde cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:12132
0x75d646 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:12011
0x75d958 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4321
0x75d958 c_parse_file()
        ../../gcc/gcc/cp/parser.c:37383
0x8b6632 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1064
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


$ cat abc.cc
class fpos;
template < state > bool operator!= (fpos,; operator!=


More information about the Gcc-bugs mailing list