[Bug c++/77945] GCC generates invalid constexpr copy/move assignment operators for types with trailing padding.
ville.voutilainen at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Oct 12 23:54:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77945
Ville Voutilainen <ville.voutilainen at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at redhat dot com,
| |ville.voutilainen at gmail dot com
--- Comment #4 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
Another test:
struct T
{
int x = 0;
bool y = 0;
constexpr T() {}
};
int main()
{
constexpr T t = (T{} = T{});
}
prog.cc: In function 'int main()':
prog.cc:10:31: error: accessing value of '<anonymous>' through a 'char [5]'
glvalue in a constant expression
constexpr T t = (T{} = T{});
^
That looks rather bad.
More information about the Gcc-bugs
mailing list