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

            Bug ID: 83602
           Summary: [8 Regression] ICE in
                    cpp_macro_definition_location(cpp_hashnode*) on
                    invalid code
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

Starting from David's commit r254978 we ICE on following invalid code:

$ cat ice.cpp
_Pragma

$ g++ ice.cpp
ice.cpp:1:1: error: _Pragma takes a parenthesized string literal
 _Pragma
 ^~~~~~~
ice.cpp:1:1: error: ‘_Pragma’ does not name a type
ice.cpp:1:1: internal compiler error: Segmentation fault
0xdb48af crash_signal
        ../../gcc/toplev.c:325
0x16de564 cpp_macro_definition_location(cpp_hashnode*)
        ../../libcpp/macro.c:3655
0x73f641 macro_use_before_def::~macro_use_before_def()
        ../../gcc/cp/name-lookup.c:5694
0x73f688 macro_use_before_def::~macro_use_before_def()
        ../../gcc/cp/name-lookup.c:5701
0x74b35e
std::default_delete<deferred_diagnostic>::operator()(deferred_diagnostic*)
const
        /usr/include/c++/7/bits/unique_ptr.h:78
0x74b35e std::unique_ptr<deferred_diagnostic,
std::default_delete<deferred_diagnostic> >::~unique_ptr()
        /usr/include/c++/7/bits/unique_ptr.h:268
0x74b35e name_hint::~name_hint()
        ../../gcc/c-family/name-hint.h:91
0x74b35e cp_parser_diagnose_invalid_type_name
        ../../gcc/cp/parser.c:3280
0x77800d cp_parser_parse_and_diagnose_invalid_type_name
        ../../gcc/cp/parser.c:3467
0x77ff8f cp_parser_simple_declaration
        ../../gcc/cp/parser.c:12915
0x780d88 cp_parser_block_declaration
        ../../gcc/cp/parser.c:12838
0x785a54 cp_parser_declaration
        ../../gcc/cp/parser.c:12736
0x785e9b cp_parser_declaration_seq_opt
        ../../gcc/cp/parser.c:12612
0x7861a0 cp_parser_translation_unit
        ../../gcc/cp/parser.c:4558
0x7861a0 c_parse_file()
        ../../gcc/cp/parser.c:38749
0x8cc956 c_common_parse_file()
        ../../gcc/c-family/c-opts.c:1127

Does it worth for fixing?

Reply via email to