https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120057
Bug ID: 120057
Summary: [15 regression] 'constexpr' integer initializer is not
an integer constant expression
Product: gcc
Version: 15.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: planet36 at gmail dot com
Target Milestone: ---
The following code compiles in 14.2, but in 15.1 the second array gives an
error.
```
[[maybe_unused]] constexpr char foo[65] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0,
};
[[maybe_unused]] constexpr char bar[66] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0,
};
```
> error: 'constexpr' integer initializer is not an integer constant expression
https://godbolt.org/z/E5MbjaTME