This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/83060] ICE on valid C++ code: in ignore_overflows, at cp/cvt.c:583


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]