[Bug c++/122465] [13/14/15/16 Regression] ICE: segmentation fault in c_parse_file() instead of normal exit when parsing malformed C++ for loop with const (or any qualifier) size_t

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Oct 30 21:00:27 GMT 2025


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE: segmentation fault in  |[13/14/15/16 Regression]
                   |c_parse_file() instead of   |ICE: segmentation fault in
                   |normal exit when parsing    |c_parse_file() instead of
                   |malformed C++ for loop with |normal exit when parsing
                   |register size_t             |malformed C++ for loop with
                   |                            |const (or any qualifier)
                   |                            |size_t
   Target Milestone|---                         |13.5
      Known to work|                            |5.4.0
      Known to fail|                            |6.1.0

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed reduced testcase:
```
void f()
{    
  int x{};
  for(const size_t i={i}:x){} /* { dg-error "" } */
}
```


More information about the Gcc-bugs mailing list