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

            Bug ID: 123667
           Summary: [14/15/16 Regression] ICE in finish_decltype_type when
                    using decltype on a structured binding inside a
                    generic lambda
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jirehguo at tju dot edu.cn
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/neeorTncs
The following c++ code crash gcc trunk.
Goes back to 14.1 with checking.
Clang and gcc 13.4 accept it.

Code:
```cpp
#include <iostream>
int main() {
  auto [x, y] = std::tuple<int, int>{0, 2};
    []<typename T>(T t) {
      using z = decltype(x);
    }(std::make_tuple(x, y));
}
```

Stack dump:
```
<source>: In lambda function:
<source>:5:27: internal compiler error: in finish_decltype_type, at
cp/semantics.cc:13065
    5 |       using z = decltype(x);
      |                           ^
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