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

            Bug ID: 96329
           Summary: [11 Regression] ICE : tree check: expected string_cst,
                    have error_mark in cp_parser_linkage_specification, at
                    cp/parser.c:14640
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: haoxintu at gmail dot com
  Target Milestone: ---

Hi, all.

This simple invalide code makes GCC ICE.

Input:
//test.cc
extern "C" ""a

Command:
g++ test.cc

Output:
test.cc:1:12: error: unable to find string literal operator ‘operator""a’ with
‘const char [2]’, ‘long unsigned int’ arguments
    1 | extern "C" ""a
      |            ^~~
test.cc:1:12: internal compiler error: tree check: expected string_cst, have
error_mark in cp_parser_linkage_specification, at cp/parser.c:14640
0x7c524f tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/tree.c:9685
0x64d693 cp_parser_linkage_specification
        ../../gcc/tree.h:3301
0x9cfa9a cp_parser_declaration
        ../../gcc/cp/parser.c:13421
0x9d015a cp_parser_translation_unit
        ../../gcc/cp/parser.c:4761
0x9d015a c_parse_file()
        ../../gcc/cp/parser.c:44043
0xae920b c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1190
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

I tested in GCC trunk 20200726, and it seems not to make GCC-10 or downwards 
versions crashed. 

Thanks,
Haoxin

Reply via email to