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

            Bug ID: 125407
           Summary: ICE in gimplify_var_or_parm_decl with co_yield inside
                    GCC statement-expression
           Product: gcc
           Version: 15.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tobias.bruell at gmail dot com
  Target Milestone: ---

Minimal reproducer (thanks Claude)

/tmp/ice_repro5.cpp:
  #include <generator>

  std::generator<int> gen()
  {
      auto v = ({ int r = 0; co_yield r; 42; });
      co_yield v;
  }

Compile:
  g++ -std=gnu++23 -c /tmp/ice_repro5.cpp

Notes:
  - Drop the local r (write co_yield 0 directly) → ICE disappears.
  - Drop the outer assignment & co_yield v → ICE disappears.
  • [Bug c++/125407] New: ICE in g... tobias.bruell at gmail dot com via Gcc-bugs

Reply via email to