diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-10-25 03:07:45 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-10-25 03:07:45 +0000 |
commit | c2c11446caaee2d5a787cc8d0310330c6364210d (patch) | |
tree | c17ef9e5f839ac4961fd90908f8d327a7ca11b36 | |
parent | ba0513de93d2fab6db5ab30b6927209fcc883078 (diff) | |
download | clang-c2c11446caaee2d5a787cc8d0310330c6364210d.tar.gz |
Make the -Wc++11-compat warnings ignored by default, so we don't break
valid C++98/03 code. However, add these warnings to -Wall, for those
who obviously already like clean code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142903 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Basic/DiagnosticGroups.td | 2 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticLexKinds.td | 2 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticParseKinds.td | 2 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 9 | ||||
-rw-r--r-- | test/CXX/class/class.friend/p6.cpp | 2 | ||||
-rw-r--r-- | test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp | 4 | ||||
-rw-r--r-- | test/CXX/temp/temp.spec/temp.explicit/p2.cpp | 2 | ||||
-rw-r--r-- | test/CXX/temp/temp.spec/temp.explicit/p3.cpp | 2 | ||||
-rw-r--r-- | test/CXX/temp/temp.spec/temp.explicit/p5.cpp | 2 | ||||
-rw-r--r-- | test/Lexer/cxx0x_keyword_as_cxx98.cpp | 2 | ||||
-rw-r--r-- | test/SemaCXX/auto-cxx98.cpp | 2 | ||||
-rw-r--r-- | test/SemaCXX/class.cpp | 2 | ||||
-rw-r--r-- | test/SemaCXX/decltype-crash.cpp | 2 |
13 files changed, 18 insertions, 17 deletions
diff --git a/include/clang/Basic/DiagnosticGroups.td b/include/clang/Basic/DiagnosticGroups.td index 343ffdab1a..91c7df7685 100644 --- a/include/clang/Basic/DiagnosticGroups.td +++ b/include/clang/Basic/DiagnosticGroups.td @@ -302,7 +302,7 @@ def Most : DiagGroup<"most", [ def ThreadSafety : DiagGroup<"thread-safety">; // -Wall is -Wmost -Wparentheses -Wtop-level-comparison -def : DiagGroup<"all", [Most, Parentheses]>; +def : DiagGroup<"all", [Most, Parentheses, CXX11Compat]>; // Aliases. def : DiagGroup<"", [Extra]>; // -W = -Wextra diff --git a/include/clang/Basic/DiagnosticLexKinds.td b/include/clang/Basic/DiagnosticLexKinds.td index 0254074de2..5206fd2c27 100644 --- a/include/clang/Basic/DiagnosticLexKinds.td +++ b/include/clang/Basic/DiagnosticLexKinds.td @@ -57,7 +57,7 @@ def ext_token_used : Extension<"extension used">, InGroup<DiagGroup<"language-extension-token">>; def warn_cxx11_keyword : Warning<"'%0' is a keyword in C++11">, - InGroup<CXX11Compat>; + InGroup<CXX11Compat>, DefaultIgnore; def warn_unterminated_string : ExtWarn<"missing terminating '\"' character">; def warn_unterminated_char : ExtWarn<"missing terminating ' character">; diff --git a/include/clang/Basic/DiagnosticParseKinds.td b/include/clang/Basic/DiagnosticParseKinds.td index 8595c43aa8..3ec893ec51 100644 --- a/include/clang/Basic/DiagnosticParseKinds.td +++ b/include/clang/Basic/DiagnosticParseKinds.td @@ -233,7 +233,7 @@ def ext_auto_type_specifier : ExtWarn< "'auto' type specifier is a C++11 extension">, InGroup<CXX11>; def warn_auto_storage_class : Warning< "'auto' storage class specifier is redundant and incompatible with C++11">, - InGroup<CXX11Compat>; + InGroup<CXX11Compat>, DefaultIgnore; def ext_auto_storage_class : ExtWarn< "'auto' storage class specifier is not permitted in C++11, and will not " "be supported in future releases">, InGroup<DiagGroup<"auto-storage-class">>; diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 41581ae49c..28d5c97ec3 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -2453,10 +2453,10 @@ def err_explicit_instantiation_must_be_global : Error< "explicit instantiation of %0 must occur at global scope">; def warn_explicit_instantiation_out_of_scope_0x : Warning< "explicit instantiation of %0 not in a namespace enclosing %1">, - InGroup<CXX11Compat>; + InGroup<CXX11Compat>, DefaultIgnore; def warn_explicit_instantiation_must_be_global_0x : Warning< "explicit instantiation of %0 must occur at global scope">, - InGroup<CXX11Compat>; + InGroup<CXX11Compat>, DefaultIgnore; def err_explicit_instantiation_requires_name : Error< "explicit instantiation declaration requires a name">; @@ -2482,7 +2482,8 @@ def note_explicit_instantiation_candidate : Note< def err_explicit_instantiation_inline : Error< "explicit instantiation cannot be 'inline'">; def warn_explicit_instantiation_inline_0x : Warning< - "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>; + "explicit instantiation cannot be 'inline'">, InGroup<CXX11Compat>, + DefaultIgnore; def err_explicit_instantiation_constexpr : Error< "explicit instantiation cannot be 'constexpr'">; def ext_explicit_instantiation_without_qualified_id : Extension< @@ -2492,7 +2493,7 @@ def err_explicit_instantiation_unqualified_wrong_namespace : Error< "explicit instantiation of %q0 must occur in namespace %1">; def warn_explicit_instantiation_unqualified_wrong_namespace_0x : Warning< "explicit instantiation of %q0 must occur in namespace %1">, - InGroup<CXX11Compat>; + InGroup<CXX11Compat>, DefaultIgnore; def err_explicit_instantiation_undefined_member : Error< "explicit instantiation of undefined %select{member class|member function|" "static data member}0 %1 of class template %2">; diff --git a/test/CXX/class/class.friend/p6.cpp b/test/CXX/class/class.friend/p6.cpp index 82a90ff82f..7d7a06419a 100644 --- a/test/CXX/class/class.friend/p6.cpp +++ b/test/CXX/class/class.friend/p6.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -Wc++11-compat -verify %s class A { friend static class B; // expected-error {{'static' is invalid in friend declarations}} diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp index 5f7ef63ae4..9140d352b2 100644 --- a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp +++ b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp @@ -1,5 +1,5 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++98 -Wno-c++11-extensions +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 -Wc++11-compat +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++98 -Wno-c++11-extensions -Wc++11-compat void f() { auto a = a; // expected-error{{variable 'a' declared with 'auto' type cannot appear in its own initializer}} auto *b = b; // expected-error{{variable 'b' declared with 'auto' type cannot appear in its own initializer}} diff --git a/test/CXX/temp/temp.spec/temp.explicit/p2.cpp b/test/CXX/temp/temp.spec/temp.explicit/p2.cpp index 822f881712..1dfcf0ce2d 100644 --- a/test/CXX/temp/temp.spec/temp.explicit/p2.cpp +++ b/test/CXX/temp/temp.spec/temp.explicit/p2.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s +// RUN: %clang_cc1 -fsyntax-only -verify -pedantic -Wc++11-compat %s // Example from the standard template<class T> class Array { void mf() { } }; diff --git a/test/CXX/temp/temp.spec/temp.explicit/p3.cpp b/test/CXX/temp/temp.spec/temp.explicit/p3.cpp index 48c42c399a..ff1438285e 100644 --- a/test/CXX/temp/temp.spec/temp.explicit/p3.cpp +++ b/test/CXX/temp/temp.spec/temp.explicit/p3.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wc++11-compat %s // A declaration of a function template shall be in scope at the point of the // explicit instantiation of the function template. diff --git a/test/CXX/temp/temp.spec/temp.explicit/p5.cpp b/test/CXX/temp/temp.spec/temp.explicit/p5.cpp index 7522d02ffa..8422c519a7 100644 --- a/test/CXX/temp/temp.spec/temp.explicit/p5.cpp +++ b/test/CXX/temp/temp.spec/temp.explicit/p5.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wc++11-compat %s namespace N { template<class T> class Y { // expected-note{{explicit instantiation refers here}} diff --git a/test/Lexer/cxx0x_keyword_as_cxx98.cpp b/test/Lexer/cxx0x_keyword_as_cxx98.cpp index d87d3dc7fa..5d16810041 100644 --- a/test/Lexer/cxx0x_keyword_as_cxx98.cpp +++ b/test/Lexer/cxx0x_keyword_as_cxx98.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 %s -verify -fsyntax-only +// RUN: %clang_cc1 %s -verify -fsyntax-only -Wc++11-compat #define constexpr const constexpr int x = 0; diff --git a/test/SemaCXX/auto-cxx98.cpp b/test/SemaCXX/auto-cxx98.cpp index 6c401ba11a..1e28d0635a 100644 --- a/test/SemaCXX/auto-cxx98.cpp +++ b/test/SemaCXX/auto-cxx98.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++98 +// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++98 -Wc++11-compat void f() { auto int a; // expected-warning {{'auto' storage class specifier is redundant and incompatible with C++11}} int auto b; // expected-warning {{'auto' storage class specifier is redundant and incompatible with C++11}} diff --git a/test/SemaCXX/class.cpp b/test/SemaCXX/class.cpp index 160f365f4b..5393230f5d 100644 --- a/test/SemaCXX/class.cpp +++ b/test/SemaCXX/class.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wc++11-compat %s class C { public: auto int errx; // expected-error {{error: storage class specified for a member declaration}} expected-warning {{'auto' storage class specifier is redundant}} diff --git a/test/SemaCXX/decltype-crash.cpp b/test/SemaCXX/decltype-crash.cpp index 50b3e49b78..002bd4cfe7 100644 --- a/test/SemaCXX/decltype-crash.cpp +++ b/test/SemaCXX/decltype-crash.cpp @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -fsyntax-only -verify %s +// RUN: %clang_cc1 -fsyntax-only -verify -Wc++11-compat %s int& a(); |