https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116443

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I don't think this is technically a bug. The C standard requires an integral
constant expression for a case label, and "str"[0] is not required to be an
integral constant expression. The C standard does allow implementations to be
flexible in what they consider to be integral constant expressions, so Clang is
allowed to accept this code, but it's not required to accept it.

So if GCC accepted this, it would be as a non-standard extension.

Reply via email to