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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Here is a C++23 (note this needs to be C++23 for the static variable inside the
constexpr) program which I would have expected to be optimized but currently is
not:
```
struct S { int id; const char *labl; };
constexpr char *f()
{
  static char ccc[] = "TextB";
  return &ccc[0];
}
const S* get_S_B()
{
  static const S s = { 456, f() };
  return &s;
}
```

Reply via email to