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

            Bug ID: 89914
           Summary: [9 Regression] ICE in nothrow_spec_p, at
                    cp/except.c:1238
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
                CC: jason at gcc dot gnu.org, paolo.carlini at oracle dot com
  Target Milestone: ---

The following invalid testcase triggers an ICE on trunk:

========================================
struct A
{
  int i = ;
};

bool b = __has_nothrow_constructor (A);
========================================

bug.cc:3:9: error: expected primary-expression at end of input
    3 |   int i = ;
      |         ^
bug.cc:6:38: internal compiler error: in nothrow_spec_p, at cp/except.c:1238
    6 | bool b = __has_nothrow_constructor (A);
      |                                      ^
0x614d85 nothrow_spec_p(tree_node const*)
        ../../gcc/gcc/cp/except.c:1238
0xa42acf finish_trait_expr(cp_trait_kind, tree_node*, tree_node*)
        ../../gcc/gcc/cp/semantics.c:9788
0x9c5a59 cp_parser_trait_expr
        ../../gcc/gcc/cp/parser.c:10365
0x9b58bf cp_parser_primary_expression
        ../../gcc/gcc/cp/parser.c:5544
0x9b9ccb cp_parser_postfix_expression
        ../../gcc/gcc/cp/parser.c:7175
0x9c75c9 cp_parser_unary_expression
        ../../gcc/gcc/cp/parser.c:8469
0x9a185f cp_parser_cast_expression
        ../../gcc/gcc/cp/parser.c:9355
0x9a206a cp_parser_binary_expression
        ../../gcc/gcc/cp/parser.c:9458
0x9a3007 cp_parser_assignment_expression
        ../../gcc/gcc/cp/parser.c:9756
0x9a2a0d cp_parser_constant_expression
        ../../gcc/gcc/cp/parser.c:10038
0x9a2fb1 cp_parser_initializer_clause
        ../../gcc/gcc/cp/parser.c:22814
0x9a6d6f cp_parser_initializer
        ../../gcc/gcc/cp/parser.c:22752
0x9cdc99 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:20468
0x9b029e cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:13539
0x9d3fc0 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:13236
0x9d473c cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4698
0x9d473c c_parse_file()
        ../../gcc/gcc/cp/parser.c:41180
0xadaa9b c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1156
Please submit a full bug report, [etc.]

The ICE is similar to PR89571, it also regressed in February 2019.
Alas the patch there did not fix it.

Reply via email to