Silently accept -Wgnu-empty-initializer
authorAaron Ballman <aaron@aaronballman.com>
Thu, 10 Aug 2023 11:22:45 +0000 (07:22 -0400)
committerTobias Hieta <tobias@hieta.se>
Wed, 30 Aug 2023 15:02:23 +0000 (17:02 +0200)
commitb8444b613b3aa465b9038a0e043988a011abbbf0
tree504413053ea951bbb6b15ba4432939556e060c74
parent5a60d716ca5b9c713b6076f66fdb09f000c5c9f8
Silently accept -Wgnu-empty-initializer

https://github.com/llvm/llvm-project/commit/5d8aaad4452f60ba8902e921d9bed606713a8f26
removed the warning group as the functionality is no longer a GNU
extension. However, users have asked for the warning group to be
supported so that code transitioning from Clang 16 to Clang 17 has an
easier migration path when compiling with -Werror. This patch restores
the warning group, but as an ignored warning group because the
functionality is now always considered to be a C extension rather than
a GNU extension. This allows users to do:

  -Werror -pedantic -Wno-gnu-empty-intializer -Wno-c2x-extensions

to silence the diagnostics in both Clang 16 and Clang 17.

Fixes https://github.com/llvm/llvm-project/issues/64357
Differential Revision: https://reviews.llvm.org/D157503

(cherry picked from commit 151214b40d869455666ca76548a9e3ad639f79de)
clang/include/clang/Basic/DiagnosticGroups.td
clang/test/Sema/empty-init.c [new file with mode: 0644]