]> granicus.if.org Git - clang/commitdiff
Make the -Wc++11-compat warnings ignored by default, so we don't break
authorDouglas Gregor <dgregor@apple.com>
Tue, 25 Oct 2011 03:07:45 +0000 (03:07 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 25 Oct 2011 03:07:45 +0000 (03:07 +0000)
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

13 files changed:
include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticLexKinds.td
include/clang/Basic/DiagnosticParseKinds.td
include/clang/Basic/DiagnosticSemaKinds.td
test/CXX/class/class.friend/p6.cpp
test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp
test/CXX/temp/temp.spec/temp.explicit/p2.cpp
test/CXX/temp/temp.spec/temp.explicit/p3.cpp
test/CXX/temp/temp.spec/temp.explicit/p5.cpp
test/Lexer/cxx0x_keyword_as_cxx98.cpp
test/SemaCXX/auto-cxx98.cpp
test/SemaCXX/class.cpp
test/SemaCXX/decltype-crash.cpp

index 343ffdab1ae9b86a7fa364b9ccce493a60df5cdc..91c7df7685231a7db9580bd58cd7e1ec22b872e7 100644 (file)
@@ -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
index 0254074de2f2f196b29d05cc5d9c2decb859a199..5206fd2c278bc94821d12f0c41c07c37806a57e5 100644 (file)
@@ -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">;
index 8595c43aa8631f801ad94f02a1e633e6c5ada75e..3ec893ec51444bdd396cb932ee1c8787ef4915e6 100644 (file)
@@ -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">>;
index 41581ae49c4807b89f9246f1bd4df4264b0835c4..28d5c97ec3afca0f31a5b6c3629c71fbd8f4fcbb 100644 (file)
@@ -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">;
index 82a90ff82f20387e34d161a366eb5b5630236466..7d7a06419a7a13f75579f49a4ec2bc4e51427ca5 100644 (file)
@@ -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}}
index 5f7ef63ae449e1c18fc14b6868ea239dc4abd114..9140d352b22da21bd4f75d72e5e09d48fe68c55a 100644 (file)
@@ -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}}
index 822f881712120c88d2bd71324023135774ea57a8..1dfcf0ce2d2f56712aeb969f892559d8306ffddc 100644 (file)
@@ -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() { } }; 
index 48c42c399a4688ca1df756f29ec9481f8da91821..ff1438285e35d2bf04f9e941fbb62f457a59a362 100644 (file)
@@ -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.
index 7522d02ffa19bbdaee644b49f7ce46e5e48dfbff..8422c519a760c728d3d9f8c3c0d7d22d61b05c40 100644 (file)
@@ -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}}
index d87d3dc7faffbb0a9f67c8ba64154a0e4f394fd6..5d168100412d2d68b8f5ea5efb8fbca82c061eb8 100644 (file)
@@ -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;
index 6c401ba11a939010521416be7d3262cd1dd9408c..1e28d0635a48db71a24675696eeb21da24594446 100644 (file)
@@ -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}}
index 160f365f4bbf2a6e90aaac16d4e0c20c7f34e09b..5393230f5dbdf0fecfc4fdd6d9ed0e43cb380475 100644 (file)
@@ -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}}
index 50b3e49b78a5a5a71575faa183bdfb1c95f467ea..002bd4cfe737f110397fadd0d58abee4a1d9dee1 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wc++11-compat %s
 
 int& a();