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

--- Comment #1 from Jireh Guo <jirehguo at tju dot edu.cn> ---
Here is another similar test case but goes back to 10.3 with checking.
Compiler Explorer: https://godbolt.org/z/Mzv7hvxf6

Code:
```cpp
struct {
  decltype([] {
struct {
int f = ;
```

Stack Dump:
```
<source>: In lambda function:
<source>:3:8: error: types may not be defined in 'decltype' expressions
    3 | struct {
      |        ^
<source>:4:10: error: expected '}' at end of input
    4 | int f = ;
      |          ^
<source>:3:8: note: to match this '{'
    3 | struct {
      |        ^
<source>:4:10: error: expected unqualified-id at end of input
    4 | int f = ;
      |          ^
<source>:4:10: error: expected '}' at end of input
<source>:2:15: note: to match this '{'
    2 |   decltype([] {
      |               ^
<source>: At global scope:
<source>:2:13: error: expected ')' at end of input
    2 |   decltype([] {
      |           ~ ^
      |             )
    3 | struct {
    4 | int f = ;
      |              
<source>:4:10: error: expected unqualified-id at end of input
    4 | int f = ;
      |          ^
<source>:4:10: error: expected '}' at end of input
<source>:1:8: note: to match this '{'
    1 | struct {
      |        ^
<source>:4:10: internal compiler error: in cp_lexer_new_from_tokens, at
cp/parser.cc:969
    4 | int f = ;
      |          ^
0x2950a78 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x294583b internal_error(char const*, ...)
        ???:0
0xb1ec34 fancy_abort(char const*, int, char const*)
        ???:0
0xd64c03 c_parse_file()
        ???:0
0xeeed49 c_common_parse_file()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1
```

Reply via email to