[Bug c++/83060] ICE on valid C++ code: in ignore_overflows, at cp/cvt.c:583
joseph at codesourcery dot com
gcc-bugzilla@gcc.gnu.org
Tue Nov 21 16:25:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83060
--- Comment #6 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
I'd say for C it's valid to reject &a.s[-1] and &a.s[__PTRDIFF_MAX__] in
static initializers, because there is no guarantee that such addresses are
valid values of the pointer type (only pointers to actual array elements
or just-past-end-of-array are necessarily valid). I don't think it's
required to reject such initializers, however. Of course when not in a
static initializer, such expressions must be accepted, while causing
undefined behavior at runtime if executed.
More information about the Gcc-bugs
mailing list