https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110158
Patrick Palka changed:
What|Removed |Added
CC||ppalka at gcc dot gnu.org
See
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110158
Andrew Pinski changed:
What|Removed |Added
CC||danakj at orodu dot net
--- Comment #3
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110158
--- Comment #4 from danakj at orodu dot net ---
Here's a repro without the std::string inside a union. It is the SSO union
inside the string that causes the error.
https://gcc.godbolt.org/z/T8oM8vYnq
```
#include
template
constexpr T fold(T
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110158
--- Comment #5 from danakj at orodu dot net ---
As a means to work around #4 in static asserts, making your string long enough
that it avoids the SSO will allow the compiler to accept it.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110158
--- Comment #6 from danakj at orodu dot net ---
In case it is of help, here's an even smaller repro that clang reports the
error in libstdc++. For whatever reason gcc does not notice the libstdc++ bug
here.
https://gcc.godbolt.org/z/Phndafeoe
`
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110158
--- Comment #7 from Jonathan Wakely ---
That bug in comment 6 has already been fixed in gcc-12.3, by the last patch for
PR 103295.
The one in comment 4 is different, and will be fixed by Nathaniel's latest
patch:
https://gcc.gnu.org/pipermail/g
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110158
--- Comment #8 from Patrick Palka ---
It seems the comment #4 testcase is still rejected on trunk after/despite
r14-4334-g28adad7a32ed92?
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110158
--- Comment #9 from Jonathan Wakely ---
Odd, I thought I'd checked it when testing r14-4334-g28adad7a32ed92.
Seems like the same issue as PR 112642 though (which has a minimized version
without std::string).
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110158
--- Comment #1 from Andrew Pinski ---
Here is a slightly reduced testcase (for a slightly different issue still
dealing with unions):
```
struct str1
{
// bool a;
char *var;
union {
char t[15];
int allocated;
};
constexpr str1()