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

            Bug ID: 127132
           Summary: ICE in expand_expr_real_1, at expr.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/4ceWTdGfh

Reproducer:
```
namespace std {
class type_info;
}

class C {
  virtual ~C();
};

void foo(const std::type_info &type);

void bar(C *c) {
  [=](auto a) { foo(typeid(*c)); }(1);
}
```

Backtrace:
during RTL pass: expand
<source>: In lambda function:
<source>:12:21: internal compiler error: in expand_expr_real_1, at
expr.cc:11786
   12 |   [=](auto a) { foo(typeid(*c)); }(1);
      |                     ^~~~~~~~~~
0x2bd7c18 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x2bcc85b internal_error(char const*, ...)
        ???:0
0xb48264 fancy_abort(char const*, int, char const*)
        ???:0
0x110fdbf store_expr(tree_node*, rtx_def*, int, bool, bool)
        ???:0


This ICE is trunk only:
https://godbolt.org/z/WMT5xocP7

Reply via email to