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
This commit is contained in:
Douglas Gregor 2010-06-14 21:15:09 +00:00
parent 078f4cec21
commit 067ad670b1
2 changed files with 5 additions and 2 deletions

View File

@ -64,6 +64,7 @@ def : DiagGroup<"newline-eof">;
def LongLong : DiagGroup<"long-long">; def LongLong : DiagGroup<"long-long">;
def MismatchedTags : DiagGroup<"mismatched-tags">; def MismatchedTags : DiagGroup<"mismatched-tags">;
def MissingFieldInitializers : DiagGroup<"missing-field-initializers">; def MissingFieldInitializers : DiagGroup<"missing-field-initializers">;
def InitializerOverrides : DiagGroup<"initializer-overrides">;
def NonNull : DiagGroup<"nonnull">; def NonNull : DiagGroup<"nonnull">;
def : DiagGroup<"nonportable-cfstrings">; def : DiagGroup<"nonportable-cfstrings">;
def : DiagGroup<"non-virtual-dtor">; def : DiagGroup<"non-virtual-dtor">;
@ -162,6 +163,7 @@ def Format2 : DiagGroup<"format=2",
def Extra : DiagGroup<"extra", [ def Extra : DiagGroup<"extra", [
MissingFieldInitializers, MissingFieldInitializers,
InitializerOverrides,
SemiBeforeMethodBody, SemiBeforeMethodBody,
SignCompare, SignCompare,
UnusedParameter UnusedParameter

View File

@ -80,9 +80,10 @@ def err_designator_for_scalar_init : Error<
"designator in initializer for scalar type %0">; "designator in initializer for scalar type %0">;
def warn_subobject_initializer_overrides : Warning< def warn_subobject_initializer_overrides : Warning<
"subobject initialization overrides initialization of other fields " "subobject initialization overrides initialization of other fields "
"within its enclosing subobject">; "within its enclosing subobject">, InGroup<InitializerOverrides>;
def warn_initializer_overrides : Warning< def warn_initializer_overrides : Warning<
"initializer overrides prior initialization of this subobject">; "initializer overrides prior initialization of this subobject">,
InGroup<InitializerOverrides>;
def note_previous_initializer : Note< def note_previous_initializer : Note<
"previous initialization %select{|with side effects }0is here" "previous initialization %select{|with side effects }0is here"
"%select{| (side effects may not occur at run time)}0">; "%select{| (side effects may not occur at run time)}0">;