[Bug c++/127131] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.cc:85, when calling a member function on the loop variable of a `template for` expansion statement

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Aug 29 22:20:03 GMT 2026


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

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2026-08-29
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |c++26

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
    <<< error >>> item;

That is definitely wrong.

Even for:
```
int main()
{
    template for (constexpr int item: {0,0}) {
        auto v = item;
    }
}
```

That is there but we don't crash.


More information about the Gcc-bugs mailing list