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

            Bug ID: 100055
           Summary: ICE on invalid requires expression
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ldalessandro at gmail dot com
  Target Milestone: ---

The following invalid code triggers a segfault.

```
void foo(auto&& arg) requires({});


<source>:1:30: error: statement-expressions are not allowed outside functions
nor in template-argument lists
    1 | void foo(auto&& arg) requires({});
      |                              ^
<source>:1:33: internal compiler error: Segmentation fault
    1 | void foo(auto&& arg) requires({});
      |                                 ^
0x1d01009 internal_error(char const*, ...)
        ???:0
0x7a1b17 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
        ???:0
0x7a7a78 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ???:0
0x8e230d c_parse_file()
        ???:0
0xa615b2 c_common_parse_file()
        ???:0
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.
ASM generation compiler returned: 1
```

live example: https://godbolt.org/z/qjWWWchjo

Reply via email to