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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
For C++ (well with GCC extensions obvious) this would be valid:
```
static constexpr const char *names[] = {
    [CE_RED] = "RED",
    [CE_GREEN] = "GREEN",
    [CE_BLUE] = "BLUE",
};
```

And gets optimized way.

But for C23, constexpr pointers have to be null.

In the original testcase you refer to `&name[0][0]` as you pass to puts. Since
you take the address of name, it still needs to be a variable.

Reply via email to