[SemaCXX] add -Woverride-init alias to -Winitializer-overrides

Summary:
https://bugs.llvm.org/show_bug.cgi?id=40251
https://github.com/ClangBuiltLinux/linux/issues/307

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits, nathanchance, srhines

Differential Revision: https://reviews.llvm.org/D56522

llvm-svn: 350877
This commit is contained in:
Nick Desaulniers 2019-01-10 19:12:39 +00:00
parent 5ea5231bec
commit 2383aad540
3 changed files with 7 additions and 0 deletions

View File

@ -7885,6 +7885,10 @@ This diagnostic is enabled by default.
| |+---------------------+| | |+---------------------+|
+-----------------------------------------------------------------------------------------------+-----------------------+ +-----------------------------------------------------------------------------------------------+-----------------------+
-Woverride-init
--------------
Synonym for `-Winitializer-overrides`_.
-Woverride-module -Woverride-module
----------------- -----------------

View File

@ -365,6 +365,8 @@ def NullArithmetic : DiagGroup<"null-arithmetic">;
def NullCharacter : DiagGroup<"null-character">; def NullCharacter : DiagGroup<"null-character">;
def NullDereference : DiagGroup<"null-dereference">; def NullDereference : DiagGroup<"null-dereference">;
def InitializerOverrides : DiagGroup<"initializer-overrides">; def InitializerOverrides : DiagGroup<"initializer-overrides">;
// For compatibility with GCC; -Woverride-init = -Winitializer-overrides
def : DiagGroup<"override-init", [InitializerOverrides]>;
def NonNull : DiagGroup<"nonnull">; def NonNull : DiagGroup<"nonnull">;
def NonPODVarargs : DiagGroup<"non-pod-varargs">; def NonPODVarargs : DiagGroup<"non-pod-varargs">;
def ClassVarargs : DiagGroup<"class-varargs", [NonPODVarargs]>; def ClassVarargs : DiagGroup<"class-varargs", [NonPODVarargs]>;

View File

@ -1,4 +1,5 @@
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Winitializer-overrides %s // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Winitializer-overrides %s
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -Woverride-init %s
template <typename T> struct Foo { template <typename T> struct Foo {
struct SubFoo { struct SubFoo {