From 067ad670b1427477d2f65cb2d3005ecb3fbe8190 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 14 Jun 2010 21:15:09 +0000 Subject: [PATCH] Put warnings about designated initializations overridding prior initializations into their own warning group, initializer-overrides, which is part of -Wextra. Patch by william@25thandClement.com, fixes PR6934! llvm-svn: 105961 --- clang/include/clang/Basic/DiagnosticGroups.td | 2 ++ clang/include/clang/Basic/DiagnosticSemaKinds.td | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/clang/include/clang/Basic/DiagnosticGroups.td b/clang/include/clang/Basic/DiagnosticGroups.td index 5dc613a7a9a7..1a7b7ec136bb 100644 --- a/clang/include/clang/Basic/DiagnosticGroups.td +++ b/clang/include/clang/Basic/DiagnosticGroups.td @@ -64,6 +64,7 @@ def : DiagGroup<"newline-eof">; def LongLong : DiagGroup<"long-long">; def MismatchedTags : DiagGroup<"mismatched-tags">; def MissingFieldInitializers : DiagGroup<"missing-field-initializers">; +def InitializerOverrides : DiagGroup<"initializer-overrides">; def NonNull : DiagGroup<"nonnull">; def : DiagGroup<"nonportable-cfstrings">; def : DiagGroup<"non-virtual-dtor">; @@ -162,6 +163,7 @@ def Format2 : DiagGroup<"format=2", def Extra : DiagGroup<"extra", [ MissingFieldInitializers, + InitializerOverrides, SemiBeforeMethodBody, SignCompare, UnusedParameter diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 7a1f9ad35fa0..337bd10fbf2b 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -80,9 +80,10 @@ def err_designator_for_scalar_init : Error< "designator in initializer for scalar type %0">; def warn_subobject_initializer_overrides : Warning< "subobject initialization overrides initialization of other fields " - "within its enclosing subobject">; + "within its enclosing subobject">, InGroup; def warn_initializer_overrides : Warning< - "initializer overrides prior initialization of this subobject">; + "initializer overrides prior initialization of this subobject">, + InGroup; def note_previous_initializer : Note< "previous initialization %select{|with side effects }0is here" "%select{| (side effects may not occur at run time)}0">;