https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89149
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |egallager at gcc dot gnu.org
--- Comment #6 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Shafik Yaghmour from comment #0)
> Given the following C++ example:
>
> void foo() {
> constexpr char c1 =
> (&(&"abc"[2])[-1])[-3];
> constexpr char c2 =
> (&(&(&"abc"[2])[-1])[-3])[4];
> }
>
> Both declarations should be ill-formed since we have out of bounds array
> access in a constant expression context. gcc correctly produces a diagnostic
> for c1 but not for c2. See live godbolt:
>
> https://godbolt.org/z/z7MrES
>
> Both clang and icc produce a diagnostic for both cases and as indicated here
> so does EDG https://twitter.com/zygoloid/status/1090863346016907264
Fixed link, so people can see what it's in reply to without being logged in:
https://xcancel.com/zygoloid/status/1090863346016907264