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

            Bug ID: 127505
           Summary: ICE in set_identifier_type_value_with_scope, at
                    cp/name-lookup.cc
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: s.kimura.h41104 at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/34hz1EfMd

Reproducer:
```
auto foo() {
  struct S {
    int i;
  };
  return S{};
}

void bar() { auto a = decltype(foo()){0}; }

struct S {
} s;
```

Backtrace:
<source>:10:8: internal compiler error: in
set_identifier_type_value_with_scope, at cp/name-lookup.cc:5350
   10 | struct S {
      |        ^
0x2c54f68 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x2c49bab internal_error(char const*, ...)
        ???:0
0xb7d362 fancy_abort(char const*, int, char const*)
        ???:0
0xd5ce80 pushdecl(tree_node*, bool)
        ???:0
0xd5d990 pushtag(tree_node*, tree_node*, TAG_how)
        ???:0
0xc63e02 xref_tag(tag_types, tree_node*, TAG_how, bool)
        ???:0
0xdd5ff3 c_parse_file()
        ???:0
0xf69879 c_common_parse_file()
        ???:0

This ICE goes back to gcc-11:
https://godbolt.org/z/856WK3a97

Reply via email to