diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2023-04-03 15:19:15 -0400 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2023-04-03 15:22:52 -0400 |
commit | 5d8aaad4452f60ba8902e921d9bed606713a8f26 (patch) | |
tree | d0e0f345b8badb989314ddcbe2320c3664ecd95c /llvm/unittests/ADT/SmallVectorTest.cpp | |
parent | a71bc5f56d1f992bfd1de2f8e2279b6d5338c6db (diff) | |
download | llvm-5d8aaad4452f60ba8902e921d9bed606713a8f26.zip llvm-5d8aaad4452f60ba8902e921d9bed606713a8f26.tar.gz llvm-5d8aaad4452f60ba8902e921d9bed606713a8f26.tar.bz2 |
[C2x] Implement support for empty brace initialization (WG14 N2900 and WG14 N3011)
This implements support for allowing {} to consistently zero initialize
objects. We already supported most of this work as a GNU extension, but
the C2x feature goes beyond what the GNU extension allowed.
The changes in this patch are:
* Removed the -Wgnu-empty-initializer warning group. The extension is
now a C2x extension warning instead. Note that use of
`-Wno-gnu-empty-initializer seems` to be quite low in the wild
(https://sourcegraph.com/search?q=context%3Aglobal+-file%3A.*test.*+%22-Wno-gnu-empty-initializer%22&patternType=standard&sm=1&groupBy=repo
which currently only gives 8 hits total), so this is not expected to
be an overly disruptive change. But I'm adding the clang vendors
review group just in case this expectation is wrong.
* Reworded the diagnostic wording to be about a C2x extension, added a
pre-C2x compat warning.
* Allow {} to zero initialize a VLA
This functionality is exposed as an extension in all older C modes
(same as the GNU extension was), but does *not* allow the extension for
VLA initialization in C++ due to concern about handling non-trivially
constructible types.
Differential Revision: https://reviews.llvm.org/D147349
Diffstat (limited to 'llvm/unittests/ADT/SmallVectorTest.cpp')
0 files changed, 0 insertions, 0 deletions