Split -Wreorder into different warnings for reordering a constructor

mem-initializer list and for reordering a designated initializer list.

llvm-svn: 370688
This commit is contained in:
Richard Smith 2019-09-02 23:17:32 +00:00
parent cacf4db571
commit 34a38a3b54
3 changed files with 9 additions and 7 deletions

View File

@ -632,7 +632,9 @@ def UnusedGetterReturnValue : DiagGroup<"unused-getter-return-value">;
def UsedButMarkedUnused : DiagGroup<"used-but-marked-unused">;
def UserDefinedLiterals : DiagGroup<"user-defined-literals">;
def UserDefinedWarnings : DiagGroup<"user-defined-warnings">;
def Reorder : DiagGroup<"reorder">;
def ReorderCtor : DiagGroup<"reorder-ctor">;
def ReorderInitList : DiagGroup<"reorder-init-list">;
def Reorder : DiagGroup<"reorder", [ReorderCtor, ReorderInitList]>;
def UndeclaredSelector : DiagGroup<"undeclared-selector">;
def ImplicitAtomic : DiagGroup<"implicit-atomic-properties">;
def CustomAtomic : DiagGroup<"custom-atomic-properties">;

View File

@ -208,7 +208,7 @@ def ext_designated_init_nested : ExtWarn<
"nested designators are a C99 extension">, InGroup<C99Designator>;
def ext_designated_init_reordered : ExtWarn<
"ISO C++ requires field designators to be specified in declaration order; "
"field %1 will be initialized after field %0">, InGroup<Reorder>,
"field %1 will be initialized after field %0">, InGroup<ReorderInitList>,
SFINAEFailure;
def note_previous_field_init : Note<
"previous initialization for field %0 is here">;
@ -7644,7 +7644,7 @@ def err_mem_init_not_member_or_class : Error<
def warn_initializer_out_of_order : Warning<
"%select{field|base class}0 %1 will be initialized after "
"%select{field|base}2 %3">,
InGroup<Reorder>, DefaultIgnore;
InGroup<ReorderCtor>, DefaultIgnore;
def warn_abstract_vbase_init_ignored : Warning<
"initializer for virtual base class %0 of abstract class %1 "
"will never be used">,

View File

@ -1,8 +1,8 @@
// RUN: %clang_cc1 -std=c++2a %s -verify=expected,pedantic,override,reorder -pedantic-errors
// RUN: %clang_cc1 -std=c++2a %s -verify=expected,pedantic -Werror=c99-designator -Wno-reorder -Wno-initializer-overrides
// RUN: %clang_cc1 -std=c++2a %s -verify=expected,reorder -Wno-c99-designator -Werror=reorder -Wno-initializer-overrides
// RUN: %clang_cc1 -std=c++2a %s -verify=expected,override -Wno-c99-designator -Wno-reorder -Werror=initializer-overrides
// RUN: %clang_cc1 -std=c++2a %s -verify -Wno-c99-designator -Wno-reorder -Wno-initializer-overrides
// RUN: %clang_cc1 -std=c++2a %s -verify=expected,pedantic -Werror=c99-designator -Wno-reorder-init-list -Wno-initializer-overrides
// RUN: %clang_cc1 -std=c++2a %s -verify=expected,reorder -Wno-c99-designator -Werror=reorder-init-list -Wno-initializer-overrides
// RUN: %clang_cc1 -std=c++2a %s -verify=expected,override -Wno-c99-designator -Wno-reorder-init-list -Werror=initializer-overrides
// RUN: %clang_cc1 -std=c++2a %s -verify -Wno-c99-designator -Wno-reorder-init-list -Wno-initializer-overrides
namespace class_with_ctor {