[cfe-commits] r147357 - in /cfe/trunk: include/clang/Basic/ lib/Parse/ lib/Sema/ test/CXX/temp/temp.spec/temp.expl.spec/ test/Misc/ test/Parser/ test/Sema/ test/SemaCXX/ test/SemaTemplate/

Richard Smith richard-llvm at metafoo.co.uk
Thu Dec 29 13:57:33 PST 2011


Author: rsmith
Date: Thu Dec 29 15:57:33 2011
New Revision: 147357

URL: http://llvm.org/viewvc/llvm-project?rev=147357&view=rev
Log:
Change the diagnostics which said 'accepted as an extension' to instead say
'is an extension'. The former is inappropriate and confusing when building with
-Werror/-pedantic-errors.

Modified:
    cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
    cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
    cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp
    cfe/trunk/lib/Parse/ParseDecl.cpp
    cfe/trunk/lib/Parse/Parser.cpp
    cfe/trunk/lib/Sema/SemaAccess.cpp
    cfe/trunk/lib/Sema/SemaInit.cpp
    cfe/trunk/lib/Sema/SemaType.cpp
    cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp
    cfe/trunk/test/Misc/warning-flags.c
    cfe/trunk/test/Parser/cxx-ext-delete-default.cpp
    cfe/trunk/test/Parser/cxx0x-in-cxx98.cpp
    cfe/trunk/test/Sema/array-init.c
    cfe/trunk/test/Sema/c89.c
    cfe/trunk/test/Sema/compound-literal.c
    cfe/trunk/test/SemaCXX/MicrosoftCompatibility.cpp
    cfe/trunk/test/SemaCXX/PR9572.cpp
    cfe/trunk/test/SemaCXX/c99-variable-length-array.cpp
    cfe/trunk/test/SemaCXX/c99.cpp
    cfe/trunk/test/SemaCXX/class.cpp
    cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp
    cfe/trunk/test/SemaCXX/cxx0x-class.cpp
    cfe/trunk/test/SemaCXX/i-c-e-cxx.cpp
    cfe/trunk/test/SemaTemplate/class-template-spec.cpp
    cfe/trunk/test/SemaTemplate/instantiate-static-var.cpp
    cfe/trunk/test/SemaTemplate/temp_class_spec_neg.cpp

Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Thu Dec 29 15:57:33 2011
@@ -38,9 +38,10 @@
   "complex integer types are an extension">;
 def ext_thread_before : Extension<"'__thread' before 'static'">;
 
-def ext_empty_struct_union : Extension<"empty %select{struct|union}0 "
-  "(accepted as an extension) has size 0 in C, size 1 in C++">, 
-  InGroup<CXXCompat>;
+def ext_empty_struct_union : Extension<
+  "empty %select{struct|union}0 is a GNU extension">, InGroup<GNU>;
+def warn_empty_struct_union_compat : Warning<"empty %select{struct|union}0 "
+  "has size 0 in C, size 1 in C++">, InGroup<CXXCompat>, DefaultIgnore;
 def error_empty_enum : Error<"use of empty enum">;
 def err_invalid_sign_spec : Error<"'%0' cannot be signed or unsigned">;
 def err_invalid_short_spec : Error<"'short %0' is invalid">;
@@ -540,21 +541,20 @@
   "%select{template name|const_cast|dynamic_cast|reinterpret_cast|static_cast}0"
   " which forms the digraph '<:' (aka '[') and a ':', did you mean '< ::'?">;
 
-def warn_deleted_function_accepted_as_extension: ExtWarn<
-  "deleted function definition accepted as a C++11 extension">, InGroup<CXX11>;
+def ext_deleted_function : ExtWarn<
+  "deleted function definitions are a C++11 extension">, InGroup<CXX11>;
 def warn_cxx98_compat_deleted_function : Warning<
   "deleted function definitions are incompatible with C++98">,
   InGroup<CXX98Compat>, DefaultIgnore;
-def warn_defaulted_function_accepted_as_extension: ExtWarn<
-  "defaulted function definition accepted as a C++11 extension">,
-  InGroup<CXX11>;
+def ext_defaulted_function : ExtWarn<
+  "defaulted function definitions are a C++11 extension">, InGroup<CXX11>;
 def warn_cxx98_compat_defaulted_function : Warning<
   "defaulted function definitions are incompatible with C++98">,
   InGroup<CXX98Compat>, DefaultIgnore;
 
 // C++11 in-class member initialization
 def ext_nonstatic_member_init : ExtWarn<
-  "in-class initialization of non-static data member accepted as a C++11 extension">,
+  "in-class initialization of non-static data member is a C++11 extension">,
   InGroup<CXX11>;
 def warn_cxx98_compat_nonstatic_member_init : Warning<
   "in-class initialization of non-static data members is incompatible with C++98">,
@@ -566,7 +566,7 @@
 
 // C++11 alias-declaration
 def ext_alias_declaration : ExtWarn<
-  "alias declarations accepted as a C++11 extension">, InGroup<CXX11>;
+  "alias declarations are a C++11 extension">, InGroup<CXX11>;
 def warn_cxx98_compat_alias_declaration : Warning<
   "alias declarations are incompatible with C++98">,
   InGroup<CXX98Compat>, DefaultIgnore;
@@ -577,7 +577,7 @@
     
 // C++11 override control
 def ext_override_control_keyword : ExtWarn<
-  "'%0' keyword accepted as a C++11 extension">, InGroup<CXX11>;
+  "'%0' keyword is a C++11 extension">, InGroup<CXX11>;
 def warn_cxx98_compat_override_control_keyword : Warning<
   "'%0' keyword is incompatible with C++98">,
   InGroup<CXX98Compat>, DefaultIgnore;

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Dec 29 15:57:33 2011
@@ -35,8 +35,7 @@
   "double precision constant requires cl_khr_fp64, casting to single precision">;
 
 // C99 variable-length arrays
-def ext_vla : Extension<
-  "variable length arrays are a C99 feature, accepted as an extension">,
+def ext_vla : Extension<"variable length arrays are a C99 feature">,
   InGroup<VLA>;
 def err_vla_non_pod : Error<"variable length array of non-POD element type %0">;
 def err_vla_in_sfinae : Error<
@@ -63,8 +62,6 @@
 // C99 Designated Initializers
 def ext_designated_init : Extension<
   "designated initializers are a C99 feature">;
-def ext_designated_init_cxx : Extension<
-  "designated initializers are a C99 feature, accepted in C++ as an extension">;
 def err_array_designator_negative : Error<
   "array designator value '%0' is negative">;
 def err_array_designator_empty_range : Error<
@@ -653,8 +650,8 @@
   "friend declaration naming a member of the declaring class is incompatible "
   "with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
 def ext_unelaborated_friend_type : ExtWarn<
-  "specify '%select{struct|union|class|enum}0' to befriend %1; accepted "
-  "as a C++11 extension">, InGroup<CXX11>;
+  "unelaborated friend declaration is a C++11 extension; specify "
+  "'%select{struct|union|class|enum}0' to befriend %1">, InGroup<CXX11>;
 def warn_cxx98_compat_unelaborated_friend_type : Warning<
   "befriending %1 without '%select{struct|union|class|enum}0' keyword is "
   "incompatible with C++98">, InGroup<CXX98Compat>, DefaultIgnore;
@@ -750,9 +747,9 @@
   "%0 redeclared with '%1' access">;
 def err_access : Error<
   "%1 is a %select{private|protected}0 member of %3">, AccessControl;
-def war_ms_using_declaration_inaccessible : ExtWarn<
-  "using declaration refers to inaccessible member '%0', which refers "
-  "to accessible member '%1', accepted for Microsoft compatibility">,
+def ext_ms_using_declaration_inaccessible : ExtWarn<
+  "using declaration referring to inaccessible member '%0' (which refers "
+  "to accessible member '%1') is a Microsoft compatibility extension">,
     AccessControl, InGroup<Microsoft>;
 def err_access_ctor : Error<
   "calling a %select{private|protected}0 constructor of class %2">, 
@@ -2314,9 +2311,9 @@
   "function|static data member|member class}0 specialization of %1 must "
   "originally be declared in namespace %2">;
 def ext_template_spec_decl_out_of_scope : ExtWarn<
-  "%select{class template|class template partial|function template|member "
-  "function|static data member|member class}0 specialization of %1 must "
-  "originally be declared in namespace %2; accepted as a C++11 extension">,
+  "first declaration of %select{class template|class template partial|"
+  "function template|member function|static data member|member class}0 "
+  "specialization of %1 outside namespace %2 is a C++11 extension">,
   InGroup<CXX11>;
 def warn_cxx98_compat_template_spec_decl_out_of_scope : Warning<
   "%select{class template|class template partial|function template|member "
@@ -4329,8 +4326,8 @@
   InGroup<DiagGroup<"conditional-type-mismatch">>;
 def err_typecheck_choose_expr_requires_constant : Error<
   "'__builtin_choose_expr' requires a constant expression">;
-def ext_typecheck_expression_not_constant_but_accepted : Extension<
-  "expression is not a constant, but is accepted as one by GNU extensions">, 
+def ext_typecheck_expression_not_constant : Extension<
+  "expression is not a constant; folding it to one is a GNU extension">,
   InGroup<GNU>;
 def warn_unused_expr : Warning<"expression result unused">,
   InGroup<UnusedValue>;
@@ -4447,10 +4444,11 @@
   "in-class initializer for static data member of type %0 requires "
   "'constexpr' specifier">;
 def err_in_class_initializer_non_constant : Error<
-  "in-class initializer is not a constant expression">;
+  "in-class initializer for static data member is not a constant expression">;
 
 def ext_in_class_initializer_non_constant : Extension<
- "in-class initializer is not a constant expression, accepted as an extension">;
+  "in-class initializer for static data member is not a constant expression; "
+  "folding it to a constant is a GNU extension">;
 
 // C++ anonymous unions and GNU anonymous structs/unions
 def ext_anonymous_union : Extension<
@@ -5021,9 +5019,11 @@
 def err_objc_array_of_interfaces : Error<
   "array of interface %0 is invalid (probably should be an array of pointers)">;
 def ext_c99_array_usage : Extension<
-  "use of C99-specific array features, accepted as an extension">, InGroup<C99>;
+  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
+  "feature">, InGroup<C99>;
 def err_c99_array_usage_cxx : Error<
-  "C99-specific array features are not permitted in C++">;
+  "%select{qualifier in |static |}0array size %select{||'[*] '}0is a C99 "
+  "feature, not permitted in C++">;
 def err_double_requires_fp64 : Error<
   "use of type 'double' requires cl_khr_fp64 extension to be enabled">;
 def err_nsconsumed_attribute_mismatch : Error<

Modified: cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp (original)
+++ cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp Thu Dec 29 15:57:33 2011
@@ -76,7 +76,7 @@
     if (Tok.is(tok::kw_delete)) {
       Diag(Tok, getLang().CPlusPlus0x ?
            diag::warn_cxx98_compat_deleted_function :
-           diag::warn_deleted_function_accepted_as_extension);
+           diag::ext_deleted_function);
 
       KWLoc = ConsumeToken();
       Actions.SetDeclDeleted(FnD, KWLoc);
@@ -84,7 +84,7 @@
     } else if (Tok.is(tok::kw_default)) {
       Diag(Tok, getLang().CPlusPlus0x ?
            diag::warn_cxx98_compat_defaulted_function :
-           diag::warn_defaulted_function_accepted_as_extension);
+           diag::ext_defaulted_function);
 
       KWLoc = ConsumeToken();
       Actions.SetDeclDefaulted(FnD, KWLoc);

Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Thu Dec 29 15:57:33 2011
@@ -2725,9 +2725,10 @@
 
   // Empty structs are an extension in C (C99 6.7.2.1p7), but are allowed in
   // C++.
-  if (Tok.is(tok::r_brace) && !getLang().CPlusPlus)
-    Diag(Tok, diag::ext_empty_struct_union)
-      << (TagType == TST_union);
+  if (Tok.is(tok::r_brace) && !getLang().CPlusPlus) {
+    Diag(Tok, diag::ext_empty_struct_union) << (TagType == TST_union);
+    Diag(Tok, diag::warn_empty_struct_union_compat) << (TagType == TST_union);
+  }
 
   SmallVector<Decl *, 32> FieldDecls;
 

Modified: cfe/trunk/lib/Parse/Parser.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/Parser.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/Parser.cpp (original)
+++ cfe/trunk/lib/Parse/Parser.cpp Thu Dec 29 15:57:33 2011
@@ -933,7 +933,7 @@
     if (Tok.is(tok::kw_delete)) {
       Diag(Tok, getLang().CPlusPlus0x ?
            diag::warn_cxx98_compat_deleted_function :
-           diag::warn_deleted_function_accepted_as_extension);
+           diag::ext_deleted_function);
 
       KWLoc = ConsumeToken();
       Actions.SetDeclDeleted(Res, KWLoc);
@@ -941,7 +941,7 @@
     } else if (Tok.is(tok::kw_default)) {
       Diag(Tok, getLang().CPlusPlus0x ?
            diag::warn_cxx98_compat_defaulted_function :
-           diag::warn_defaulted_function_accepted_as_extension);
+           diag::ext_defaulted_function);
 
       KWLoc = ConsumeToken();
       Actions.SetDeclDefaulted(Res, KWLoc);

Modified: cfe/trunk/lib/Sema/SemaAccess.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaAccess.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaAccess.cpp (original)
+++ cfe/trunk/lib/Sema/SemaAccess.cpp Thu Dec 29 15:57:33 2011
@@ -1166,7 +1166,7 @@
     if (Entity.getTargetDecl()->getAccess() == AS_private && 
         (OrigDecl->getAccess() == AS_public ||
          OrigDecl->getAccess() == AS_protected)) {
-      S.Diag(AccessLoc, diag::war_ms_using_declaration_inaccessible) 
+      S.Diag(AccessLoc, diag::ext_ms_using_declaration_inaccessible)
         << Shadow->getUsingDecl()->getQualifiedNameAsString()
         << OrigDecl->getQualifiedNameAsString();
       return true;

Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Thu Dec 29 15:57:33 2011
@@ -2242,10 +2242,7 @@
                                  InitExpressions.data(), InitExpressions.size(),
                                  Loc, GNUSyntax, Init.takeAs<Expr>());
 
-  if (getLangOptions().CPlusPlus)
-    Diag(DIE->getLocStart(), diag::ext_designated_init_cxx)
-      << DIE->getSourceRange();
-  else if (!getLangOptions().C99)
+  if (!getLangOptions().C99)
     Diag(DIE->getLocStart(), diag::ext_designated_init)
       << DIE->getSourceRange();
 

Modified: cfe/trunk/lib/Sema/SemaType.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaType.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaType.cpp (original)
+++ cfe/trunk/lib/Sema/SemaType.cpp Thu Dec 29 15:57:33 2011
@@ -1357,9 +1357,9 @@
       else
         Diag(Loc, diag::ext_vla);
     } else if (ASM != ArrayType::Normal || Quals != 0)
-      Diag(Loc, 
+      Diag(Loc,
            getLangOptions().CPlusPlus? diag::err_c99_array_usage_cxx
-                                     : diag::ext_c99_array_usage);
+                                     : diag::ext_c99_array_usage) << ASM;
   }
 
   return T;

Modified: cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.spec/temp.expl.spec/p2.cpp Thu Dec 29 15:57:33 2011
@@ -36,7 +36,8 @@
   template<> void N0::f0(long) { } // expected-error{{not in a namespace enclosing}}
 }
 
-template<> void N0::f0(double) { } // expected-warning{{originally be declared}}
+template<> void N0::f0(double); // expected-warning{{C++11 extension}}
+template<> void N0::f0(double) { }
 
 struct X1 {
   template<typename T> void f(T);
@@ -75,7 +76,7 @@
 
 template<typename T> T N0::X0<T>::member;
 
-template<> struct N0::X0<void> { }; // expected-warning{{originally}}
+template<> struct N0::X0<void> { }; // expected-warning{{C++11 extension}}
 N0::X0<void> test_X0;
 
 namespace N1 {
@@ -124,7 +125,7 @@
   return N0::X0<NonDefaultConstructible>::member;
 }
 
-template<> int N0::X0<int>::member;  // expected-warning{{originally}}
+template<> int N0::X0<int>::member;  // expected-warning{{C++11 extension}}
 
 template<> float N0::X0<float>::member = 3.14f;
 
@@ -152,7 +153,7 @@
 }
 
 template<>
-struct N0::X0<long>::Inner { }; // expected-warning{{originally}}
+struct N0::X0<long>::Inner { }; // expected-warning{{C++11 extension}}
 
 template<>
 struct N0::X0<float>::Inner { };

Modified: cfe/trunk/test/Misc/warning-flags.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Misc/warning-flags.c?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/Misc/warning-flags.c (original)
+++ cfe/trunk/test/Misc/warning-flags.c Thu Dec 29 15:57:33 2011
@@ -17,7 +17,7 @@
 
 The list of warnings below should NEVER grow.  It should gradually shrink to 0.
 
-CHECK: Warnings without flags (269):
+CHECK: Warnings without flags (268):
 CHECK-NEXT:   ext_anon_param_requires_type_specifier
 CHECK-NEXT:   ext_anonymous_struct_union_qualified
 CHECK-NEXT:   ext_array_init_copy
@@ -25,7 +25,6 @@
 CHECK-NEXT:   ext_cast_fn_obj
 CHECK-NEXT:   ext_delete_void_ptr_operand
 CHECK-NEXT:   ext_designated_init
-CHECK-NEXT:   ext_designated_init_cxx
 CHECK-NEXT:   ext_duplicate_declspec
 CHECK-NEXT:   ext_ellipsis_exception_spec
 CHECK-NEXT:   ext_empty_fnmacro_arg

Modified: cfe/trunk/test/Parser/cxx-ext-delete-default.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx-ext-delete-default.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/Parser/cxx-ext-delete-default.cpp (original)
+++ cfe/trunk/test/Parser/cxx-ext-delete-default.cpp Thu Dec 29 15:57:33 2011
@@ -1,11 +1,11 @@
 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
 
 struct A {
-  A(const A&) = delete; // expected-warning {{accepted as a C++11 extension}}
-  A& operator=(const A&) = delete; // expected-warning {{accepted as a C++11 extension}}
-  A() = default; // expected-warning {{accepted as a C++11 extension}}
+  A(const A&) = delete; // expected-warning {{C++11 extension}}
+  A& operator=(const A&) = delete; // expected-warning {{C++11 extension}}
+  A() = default; // expected-warning {{C++11 extension}}
   ~A();
 };
 
-void f() = delete; // expected-warning {{accepted as a C++11 extension}}
-A::~A() = default; //expected-warning {{accepted as a C++11 extension}}
+void f() = delete; // expected-warning {{C++11 extension}}
+A::~A() = default; //expected-warning {{C++11 extension}}

Modified: cfe/trunk/test/Parser/cxx0x-in-cxx98.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx0x-in-cxx98.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/Parser/cxx0x-in-cxx98.cpp (original)
+++ cfe/trunk/test/Parser/cxx0x-in-cxx98.cpp Thu Dec 29 15:57:33 2011
@@ -12,9 +12,9 @@
   virtual void f();
   virtual void g();
 };
-struct D final : B { // expected-warning {{'final' keyword accepted as a C++11 extension}}
-  virtual void f() override; // expected-warning {{'override' keyword accepted as a C++11 extension}}
-  virtual void g() final; // expected-warning {{'final' keyword accepted as a C++11 extension}}
+struct D final : B { // expected-warning {{'final' keyword is a C++11 extension}}
+  virtual void f() override; // expected-warning {{'override' keyword is a C++11 extension}}
+  virtual void g() final; // expected-warning {{'final' keyword is a C++11 extension}}
 };
 
 void NewBracedInitList() {

Modified: cfe/trunk/test/Sema/array-init.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/array-init.c?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/Sema/array-init.c (original)
+++ cfe/trunk/test/Sema/array-init.c Thu Dec 29 15:57:33 2011
@@ -218,7 +218,7 @@
 }
 
 // PR2151
-void emptyInit() {struct {} x[] = {6};} //expected-warning{{empty struct (accepted as an extension) has size 0 in C, size 1 in C++}} \
+void emptyInit() {struct {} x[] = {6};} //expected-warning{{empty struct is a GNU extension}} \
 // expected-error{{initializer for aggregate with no elements}}
 
 void noNamedInit() {
@@ -242,7 +242,7 @@
 };
 
 static void sppp_ipv6cp_up();
-const struct {} ipcp = { sppp_ipv6cp_up }; //expected-warning{{empty struct (accepted as an extension) has size 0 in C, size 1 in C++}} \
+const struct {} ipcp = { sppp_ipv6cp_up }; //expected-warning{{empty struct is a GNU extension}} \
 // expected-warning{{excess elements in struct initializer}}
 
 struct _Matrix { union { float m[4][4]; }; }; //expected-warning{{anonymous unions are a GNU extension in C}}

Modified: cfe/trunk/test/Sema/c89.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/c89.c?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/Sema/c89.c (original)
+++ cfe/trunk/test/Sema/c89.c Thu Dec 29 15:57:33 2011
@@ -61,11 +61,11 @@
 void foo(void) {}
 
 /* PR2759 */
-void test10 (int x[*]); /* expected-warning {{variable length arrays are a C99 feature, accepted as an extension}} */
-void test11 (int x[static 4]); /* expected-warning {{use of C99-specific array features}} */
+void test10 (int x[*]); /* expected-warning {{variable length arrays are a C99 feature}} */
+void test11 (int x[static 4]); /* expected-warning {{static array size is a C99 feature}} */
 
-void test12 (int x[const 4]) { /* expected-warning {{use of C99-specific array features}} */
-  int Y[x[1]]; /* expected-warning {{variable length arrays are a C99 feature, accepted as an extension}} */
+void test12 (int x[const 4]) { /* expected-warning {{qualifier in array size is a C99 feature}} */
+  int Y[x[1]]; /* expected-warning {{variable length arrays are a C99 feature}} */
 }
 
 /* PR4074 */

Modified: cfe/trunk/test/Sema/compound-literal.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/compound-literal.c?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/Sema/compound-literal.c (original)
+++ cfe/trunk/test/Sema/compound-literal.c Thu Dec 29 15:57:33 2011
@@ -12,7 +12,7 @@
 static int *p2 = (int []){2,x}; // -expected-error {{initializer element is not a compile-time constant}}
 static long *p3 = (long []){2,"x"}; // -expected-warning {{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [2]'}}
 
-typedef struct { } cache_t; // -expected-warning{{empty struct (accepted as an extension) has size 0 in C, size 1 in C++}}
+typedef struct { } cache_t; // -expected-warning{{empty struct is a GNU extension}}
 static cache_t clo_I1_cache = ((cache_t) { } ); // -expected-warning{{use of GNU empty initializer extension}}
 
 typedef struct Test {int a;int b;} Test;

Modified: cfe/trunk/test/SemaCXX/MicrosoftCompatibility.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/MicrosoftCompatibility.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/MicrosoftCompatibility.cpp (original)
+++ cfe/trunk/test/SemaCXX/MicrosoftCompatibility.cpp Thu Dec 29 15:57:33 2011
@@ -84,7 +84,7 @@
 
 class C : public B { 
 private:   
-  using B::f; // expected-warning {{using declaration refers to inaccessible member 'ms_using_declaration_bug::B::f', which refers to accessible member 'ms_using_declaration_bug::A::f', accepted for Microsoft compatibility}}
+  using B::f; // expected-warning {{using declaration referring to inaccessible member 'ms_using_declaration_bug::B::f' (which refers to accessible member 'ms_using_declaration_bug::A::f') is a Microsoft compatibility extension}}
 };
 
 }

Modified: cfe/trunk/test/SemaCXX/PR9572.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/PR9572.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/PR9572.cpp (original)
+++ cfe/trunk/test/SemaCXX/PR9572.cpp Thu Dec 29 15:57:33 2011
@@ -3,7 +3,7 @@
   virtual ~Base(); // expected-note {{implicitly declared private here}}
 };
 struct Foo : public Base { // expected-error {{base class 'Base' has private destructor}}
-  const int kBlah = 3; // expected-warning {{accepted as a C++11 extension}}
+  const int kBlah = 3; // expected-warning {{is a C++11 extension}}
   Foo();
 };
 struct Bar : public Foo {

Modified: cfe/trunk/test/SemaCXX/c99-variable-length-array.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/c99-variable-length-array.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/c99-variable-length-array.cpp (original)
+++ cfe/trunk/test/SemaCXX/c99-variable-length-array.cpp Thu Dec 29 15:57:33 2011
@@ -14,8 +14,8 @@
 
 // We allow VLAs of POD types, only.
 void vla(int N) {
-  int array1[N]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
-  POD array2[N]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+  int array1[N]; // expected-warning{{variable length arrays are a C99 feature}}
+  POD array2[N]; // expected-warning{{variable length arrays are a C99 feature}}
   NonPOD array3[N]; // expected-error{{variable length array of non-POD element type 'NonPOD'}}
   NonPOD2 array4[N][3]; // expected-error{{variable length array of non-POD element type 'NonPOD2'}}
 }
@@ -23,7 +23,7 @@
 /// Warn about VLAs in templates.
 template<typename T>
 void vla_in_template(int N, T t) {
-  int array1[N]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+  int array1[N]; // expected-warning{{variable length arrays are a C99 feature}}
 }
 
 struct HasConstantValue {
@@ -36,7 +36,7 @@
 
 template<typename T>
 void vla_in_template(T t) {
-  int array2[T::value]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+  int array2[T::value]; // expected-warning{{variable length arrays are a C99 feature}}
 }
 
 template void vla_in_template<HasConstantValue>(HasConstantValue);
@@ -47,14 +47,14 @@
 // Cannot use any variably-modified type with a template parameter or
 // argument.
 void inst_with_vla(int N) {
-  int array[N]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+  int array[N]; // expected-warning{{variable length arrays are a C99 feature}}
   X0<__typeof__(array)> x0a; // expected-error{{variably modified type 'typeof (array)' (aka 'int [N]') cannot be used as a template argument}}
 }
 
 template<typename T>
 struct X1 {
   template<int (&Array)[T::value]> // expected-error{{non-type template parameter of variably modified type 'int (&)[HasNonConstantValue::value]'}}  \
-  // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+  // expected-warning{{variable length arrays are a C99 feature}}
   struct Inner {
     
   };
@@ -68,7 +68,7 @@
 void accept_array(T (&array)[N]); // expected-note{{candidate template ignored: failed template argument deduction}}
 
 void test_accept_array(int N) {
-  int array[N]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+  int array[N]; // expected-warning{{variable length arrays are a C99 feature}}
   accept_array(array); // expected-error{{no matching function for call to 'accept_array'}}
 }
 
@@ -77,7 +77,7 @@
   struct X {
     int size;
     int array[N]; // expected-error{{fields must have a constant size: 'variable length array in structure' extension will never be supported}} \
-                  // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+                  // expected-warning{{variable length arrays are a C99 feature}}
   };
 }
 
@@ -87,7 +87,7 @@
       float left;
       float right;
     };
-    struct edge_info edgeInfo[x]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+    struct edge_info edgeInfo[x]; // expected-warning{{variable length arrays are a C99 feature}}
   }
 }
 
@@ -95,7 +95,7 @@
   template<typename T>
   void f(int i) {
     const unsigned value = i;
-    int array[value * i]; // expected-warning 2{{variable length arrays are a C99 feature, accepted as an extension}}
+    int array[value * i]; // expected-warning 2{{variable length arrays are a C99 feature}}
   }
 
   template void f<int>(int); // expected-note{{instantiation of}}
@@ -109,7 +109,7 @@
     typedef typename T::my_int my_int;
     void f0() {
       int M = 4;
-      my_int a[M]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+      my_int a[M]; // expected-warning{{variable length arrays are a C99 feature}}
     }
   };
   B<A> a;
@@ -117,7 +117,7 @@
 
 namespace PR8209 {
   void f(int n) {
-    typedef int vla_type[n]; // expected-warning{{variable length arrays are a C99 feature, accepted as an extension}}
+    typedef int vla_type[n]; // expected-warning{{variable length arrays are a C99 feature}}
     (void)new vla_type; // expected-error{{variably}}
   }
 }

Modified: cfe/trunk/test/SemaCXX/c99.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/c99.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/c99.cpp (original)
+++ cfe/trunk/test/SemaCXX/c99.cpp Thu Dec 29 15:57:33 2011
@@ -4,6 +4,6 @@
 
 struct Point { int x; int y; };
 
-Point p1 = { .x = 17, // expected-warning{{designated initializers are a C99 feature, accepted in C++ as an extension}} 
-             y: 25 }; // expected-warning{{designated initializers are a C99 feature, accepted in C++ as an extension}} \
+Point p1 = { .x = 17, // expected-warning{{designated initializers are a C99 feature}}
+             y: 25 }; // expected-warning{{designated initializers are a C99 feature}} \
                       // expected-warning{{use of GNU old-style field designator extension}}

Modified: cfe/trunk/test/SemaCXX/class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/class.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/class.cpp (original)
+++ cfe/trunk/test/SemaCXX/class.cpp Thu Dec 29 15:57:33 2011
@@ -34,10 +34,10 @@
 
   enum E1 { en1, en2 };
 
-  int i = 0; // expected-warning {{in-class initialization of non-static data member accepted as a C++11 extension}}
+  int i = 0; // expected-warning {{in-class initialization of non-static data member is a C++11 extension}}
   static int si = 0; // expected-error {{non-const static data member must be initialized out of line}}
   static const NestedC ci = 0; // expected-error {{static data member of type 'const C::NestedC' must be initialized out of line}}
-  static const int nci = vs; // expected-error {{in-class initializer is not a constant expression}}
+  static const int nci = vs; // expected-error {{in-class initializer for static data member is not a constant expression}}
   static const int vi = 0;
   static const volatile int cvi = 0; // ok, illegal in C++11
   static const E evi = 0;
@@ -174,7 +174,7 @@
 
   struct A {
     static const float x = 5.0f; // expected-warning {{in-class initializer for static data member of type 'const float' is a GNU extension}}
-    static const float y = foo(); // expected-warning {{in-class initializer for static data member of type 'const float' is a GNU extension}} expected-error {{in-class initializer is not a constant expression}}
+    static const float y = foo(); // expected-warning {{in-class initializer for static data member of type 'const float' is a GNU extension}} expected-error {{in-class initializer for static data member is not a constant expression}}
   };
 }
 

Modified: cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp (original)
+++ cfe/trunk/test/SemaCXX/constant-expression-cxx11.cpp Thu Dec 29 15:57:33 2011
@@ -168,7 +168,7 @@
   constexpr int f() { return 1; }
   typedef double (*DoubleFn)();
   typedef int (*IntFn)();
-  int a[(int)DoubleFn(f)()]; // expected-error {{variable length array}} expected-warning{{extension}}
+  int a[(int)DoubleFn(f)()]; // expected-error {{variable length array}} expected-warning{{C99 feature}}
   int b[(int)IntFn(f)()];    // ok
 }
 
@@ -462,7 +462,7 @@
 expected-error {{static_assert expression is not an integral constant expression}} \
 expected-note {{in call to 'fail(zs[1][0][1][0])'}}
 
-constexpr int arr[40] = { 1, 2, 3, [8] = 4 }; // expected-warning {{extension}}
+constexpr int arr[40] = { 1, 2, 3, [8] = 4 }; // expected-warning {{C99 feature}}
 constexpr int SumNonzero(const int *p) {
   return *p + (*p ? SumNonzero(p+1) : 0);
 }
@@ -718,7 +718,7 @@
   int b;
 };
 
-constexpr U u[4] = { { .a = 0 }, { .b = 1 }, { .a = 2 }, { .b = 3 } }; // expected-warning 4{{extension}}
+constexpr U u[4] = { { .a = 0 }, { .b = 1 }, { .a = 2 }, { .b = 3 } }; // expected-warning 4{{C99 feature}}
 static_assert(u[0].a == 0, "");
 static_assert(u[0].b, ""); // expected-error {{constant expression}} expected-note {{read of member 'b' of union with active member 'a'}}
 static_assert(u[1].b == 1, "");

Modified: cfe/trunk/test/SemaCXX/cxx0x-class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cxx0x-class.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/cxx0x-class.cpp (original)
+++ cfe/trunk/test/SemaCXX/cxx0x-class.cpp Thu Dec 29 15:57:33 2011
@@ -11,7 +11,7 @@
   int i = 0;
   static int si = 0; // expected-error {{non-const static data member must be initialized out of line}}
   static const NestedC ci = 0; // expected-error {{static data member of type 'const C::NestedC' must be initialized out of line}}
-  static const int nci = vs; // expected-error {{in-class initializer is not a constant expression}}
+  static const int nci = vs; // expected-error {{in-class initializer for static data member is not a constant expression}}
   static const int vi = 0;
   static const volatile int cvi = 0; // expected-error {{static const volatile data member must be initialized out of line}}
 };
@@ -21,7 +21,7 @@
 
   struct A {
     static const float x = 5.0f; // expected-warning {{GNU extension}} expected-note {{use 'constexpr' specifier to silence this warning}}
-    static const float y = foo(); // expected-warning {{GNU extension}} expected-note {{use 'constexpr' specifier to silence this warning}} expected-error {{in-class initializer is not a constant expression}}
+    static const float y = foo(); // expected-warning {{GNU extension}} expected-note {{use 'constexpr' specifier to silence this warning}} expected-error {{in-class initializer for static data member is not a constant expression}}
     static constexpr float x2 = 5.0f;
     static constexpr float y2 = foo(); // expected-error {{must be initialized by a constant expression}} expected-note {{non-constexpr function 'foo'}}
   };

Modified: cfe/trunk/test/SemaCXX/i-c-e-cxx.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/i-c-e-cxx.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/i-c-e-cxx.cpp (original)
+++ cfe/trunk/test/SemaCXX/i-c-e-cxx.cpp Thu Dec 29 15:57:33 2011
@@ -48,7 +48,7 @@
 namespace rdar9204520 {
   
 struct A {
-  static const int B = int(0.75 * 1000 * 1000); // expected-warning {{not a constant expression, accepted as an extension}}
+  static const int B = int(0.75 * 1000 * 1000); // expected-warning {{not a constant expression; folding it to a constant is a GNU extension}}
 };
 
 int foo() { return A::B; }

Modified: cfe/trunk/test/SemaTemplate/class-template-spec.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/class-template-spec.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/class-template-spec.cpp (original)
+++ cfe/trunk/test/SemaTemplate/class-template-spec.cpp Thu Dec 29 15:57:33 2011
@@ -86,7 +86,7 @@
 
 template<> struct N::B<int> { }; // okay
 
-template<> struct N::B<float> { }; // expected-warning{{originally}}
+template<> struct N::B<float> { }; // expected-warning{{C++11 extension}}
 
 namespace M {
   template<> struct ::N::B<short> { }; // expected-error{{class template specialization of 'B' not in a namespace enclosing 'N'}}

Modified: cfe/trunk/test/SemaTemplate/instantiate-static-var.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-static-var.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-static-var.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-static-var.cpp Thu Dec 29 15:57:33 2011
@@ -2,7 +2,7 @@
 template<typename T, T Divisor>
 class X {
 public:
-  static const T value = 10 / Divisor; // expected-error{{in-class initializer is not a constant expression}}
+  static const T value = 10 / Divisor; // expected-error{{in-class initializer for static data member is not a constant expression}}
 };
 
 int array1[X<int, 2>::value == 5? 1 : -1];
@@ -114,4 +114,3 @@
   template class X1<char>;
 
 }
-

Modified: cfe/trunk/test/SemaTemplate/temp_class_spec_neg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/temp_class_spec_neg.cpp?rev=147357&r1=147356&r2=147357&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/temp_class_spec_neg.cpp (original)
+++ cfe/trunk/test/SemaTemplate/temp_class_spec_neg.cpp Thu Dec 29 15:57:33 2011
@@ -9,7 +9,7 @@
 }
 
 template<typename T>
-struct N::M::A<T*> { }; // expected-warning{{originally}}
+struct N::M::A<T*> { }; // expected-warning{{C++11 extension}}
 
 // C++ [temp.class.spec]p9
 //   bullet 1





More information about the cfe-commits mailing list