[cfe-commits] r142903 - in /cfe/trunk: include/clang/Basic/ test/CXX/class/class.friend/ test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/ test/CXX/temp/temp.spec/temp.explicit/ test/Lexer/ test/SemaCXX/
Douglas Gregor
dgregor at apple.com
Mon Oct 24 20:07:45 PDT 2011
Author: dgregor
Date: Mon Oct 24 22:07:45 2011
New Revision: 142903
URL: http://llvm.org/viewvc/llvm-project?rev=142903&view=rev
Log:
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.
Modified:
cfe/trunk/include/clang/Basic/DiagnosticGroups.td
cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/test/CXX/class/class.friend/p6.cpp
cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp
cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p2.cpp
cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p3.cpp
cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p5.cpp
cfe/trunk/test/Lexer/cxx0x_keyword_as_cxx98.cpp
cfe/trunk/test/SemaCXX/auto-cxx98.cpp
cfe/trunk/test/SemaCXX/class.cpp
cfe/trunk/test/SemaCXX/decltype-crash.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticGroups.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticGroups.td?rev=142903&r1=142902&r2=142903&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticGroups.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticGroups.td Mon Oct 24 22:07:45 2011
@@ -302,7 +302,7 @@
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
Modified: cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td?rev=142903&r1=142902&r2=142903&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticLexKinds.td Mon Oct 24 22:07:45 2011
@@ -57,7 +57,7 @@
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">;
Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=142903&r1=142902&r2=142903&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Mon Oct 24 22:07:45 2011
@@ -233,7 +233,7 @@
"'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">>;
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=142903&r1=142902&r2=142903&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Mon Oct 24 22:07:45 2011
@@ -2453,10 +2453,10 @@
"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 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 @@
"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">;
Modified: cfe/trunk/test/CXX/class/class.friend/p6.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/class/class.friend/p6.cpp?rev=142903&r1=142902&r2=142903&view=diff
==============================================================================
--- cfe/trunk/test/CXX/class/class.friend/p6.cpp (original)
+++ cfe/trunk/test/CXX/class/class.friend/p6.cpp Mon Oct 24 22:07:45 2011
@@ -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}}
Modified: cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp?rev=142903&r1=142902&r2=142903&view=diff
==============================================================================
--- cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp (original)
+++ cfe/trunk/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p3.cpp Mon Oct 24 22:07:45 2011
@@ -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}}
Modified: cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p2.cpp?rev=142903&r1=142902&r2=142903&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p2.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p2.cpp Mon Oct 24 22:07:45 2011
@@ -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() { } };
Modified: cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p3.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p3.cpp?rev=142903&r1=142902&r2=142903&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p3.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p3.cpp Mon Oct 24 22:07:45 2011
@@ -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.
Modified: cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p5.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p5.cpp?rev=142903&r1=142902&r2=142903&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p5.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.spec/temp.explicit/p5.cpp Mon Oct 24 22:07:45 2011
@@ -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}}
Modified: cfe/trunk/test/Lexer/cxx0x_keyword_as_cxx98.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Lexer/cxx0x_keyword_as_cxx98.cpp?rev=142903&r1=142902&r2=142903&view=diff
==============================================================================
--- cfe/trunk/test/Lexer/cxx0x_keyword_as_cxx98.cpp (original)
+++ cfe/trunk/test/Lexer/cxx0x_keyword_as_cxx98.cpp Mon Oct 24 22:07:45 2011
@@ -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;
Modified: cfe/trunk/test/SemaCXX/auto-cxx98.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/auto-cxx98.cpp?rev=142903&r1=142902&r2=142903&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/auto-cxx98.cpp (original)
+++ cfe/trunk/test/SemaCXX/auto-cxx98.cpp Mon Oct 24 22:07:45 2011
@@ -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}}
Modified: cfe/trunk/test/SemaCXX/class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/class.cpp?rev=142903&r1=142902&r2=142903&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/class.cpp (original)
+++ cfe/trunk/test/SemaCXX/class.cpp Mon Oct 24 22:07:45 2011
@@ -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}}
Modified: cfe/trunk/test/SemaCXX/decltype-crash.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/decltype-crash.cpp?rev=142903&r1=142902&r2=142903&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/decltype-crash.cpp (original)
+++ cfe/trunk/test/SemaCXX/decltype-crash.cpp Mon Oct 24 22:07:45 2011
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wc++11-compat %s
int& a();
More information about the cfe-commits
mailing list