c: Disallow braces around C2x auto initializers
authorJoseph Myers <joseph@codesourcery.com>
Fri, 27 Jan 2023 21:38:57 +0000 (21:38 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 27 Jan 2023 21:38:57 +0000 (21:38 +0000)
commit84eb39556cc8449e04b5f48bd5c131941a7a2529
tree0056eecba51f070de3a4e06310aa0c71361bd500
parent815e5740162d2d0b7b54031f72c201065016d58c
c: Disallow braces around C2x auto initializers

WG14 agreed at this week's meeting to remove support for braces around
auto scalar initializers, as incompatible with C++ auto handling of
braced initializers; thus remove that support in GCC.

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

gcc/c/
* c-parser.cc (c_parser_declaration_or_fndef): Do not allow braces
around auto initializer.

gcc/testsuite/
* gcc.dg/c2x-auto-1.c, gcc.dg/c2x-auto-3.c: Expect braces around
auto initializers to be disallowed.
gcc/c/c-parser.cc
gcc/testsuite/gcc.dg/c2x-auto-1.c
gcc/testsuite/gcc.dg/c2x-auto-3.c