]> granicus.if.org Git - clang/commitdiff
Minor tweaks to r229447 to ensure the attribute is properly quoted when diagnosed.
authorAaron Ballman <aaron@aaronballman.com>
Mon, 16 Feb 2015 23:12:37 +0000 (23:12 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Mon, 16 Feb 2015 23:12:37 +0000 (23:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@229454 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaDeclAttr.cpp
test/Parser/cxx0x-attributes.cpp
test/SemaCXX/for-range-examples.cpp
test/SemaCXX/generalized-deprecated.cpp

index b2cb545a0903a0661aa65f05106267d44a403671..d979fe1cbe12e60b2aeb8482e912327139e0c273 100644 (file)
@@ -7233,9 +7233,8 @@ def err_asm_naked_this_ref : Error<
 def err_asm_naked_parm_ref : Error<
   "parameter references not allowed in naked functions">;
 
-def ext_use_of_attribute_is_a_cxx14_extension
-    : ExtWarn<"use of the %0 attribute is a C++14 extension">,
-      InGroup<CXX14>;
+def ext_use_of_attribute_is_a_cxx14_extension : ExtWarn<
+  "use of the %0 attribute is a C++14 extension">, InGroup<CXX14>;
 
 // OpenCL warnings and errors.
 def err_invalid_astype_of_different_size : Error<
index 42cfd9afa019d975f3064b0dc512e578fa97bee2..4abe480c52b40979447e0b8d559784d35920820f 100644 (file)
@@ -4259,7 +4259,7 @@ static void handleDeprecatedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
     if (Attr.isCXX11Attribute() &&
         !(Attr.hasScope() && Attr.getScopeName()->isStr("gnu")))
       S.Diag(Attr.getLoc(), diag::ext_use_of_attribute_is_a_cxx14_extension)
-          << Attr.getName()->getNameStart();
+          << Attr.getName();
 
   handleAttrWithMessage<DeprecatedAttr>(S, D, Attr);
 }
index ab0ce192fca0b214d6f2b9e4ed0c546f8017164a..33987f94c2e6f4765a8213d3254d2b09d030ea81 100644 (file)
@@ -288,7 +288,7 @@ namespace arguments {
   void f[[gnu::format(printf, 1, 2)]](const char*, ...);
   void g() [[unknown::foo(ignore arguments for unknown attributes, even with symbols!)]]; // expected-warning {{unknown attribute 'foo' ignored}}
   [[deprecated("with argument")]] int i;
-  // expected-warning@-1 {{use of the deprecated attribute is a C++14 extension}}
+  // expected-warning@-1 {{use of the 'deprecated' attribute is a C++14 extension}}
 }
 
 // Forbid attributes on decl specifiers.
@@ -331,12 +331,12 @@ namespace GccASan {
 
 namespace {
   [[deprecated]] void bar();
-  // expected-warning@-1 {{use of the deprecated attribute is a C++14 extension}}
+  // expected-warning@-1 {{use of the 'deprecated' attribute is a C++14 extension}}
   [[deprecated("hello")]] void baz();
-  // expected-warning@-1 {{use of the deprecated attribute is a C++14 extension}}
+  // expected-warning@-1 {{use of the 'deprecated' attribute is a C++14 extension}}
   [[deprecated()]] void foo();
   // expected-error@-1 {{parentheses must be omitted if 'deprecated' attribute's argument list is empty}}
-  // expected-warning@-2 {{use of the deprecated attribute is a C++14 extension}}
+  // expected-warning@-2 {{use of the 'deprecated' attribute is a C++14 extension}}
   [[gnu::deprecated()]] void quux();
 }
 
index f2b155ad7e582bdf2214adcfc4175b851382d24b..9359ae63a60b0a54e8151644e5612ca1d0f9d753 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11 
+// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++11
 
 namespace value_range_detail {
   template<typename T>
@@ -226,7 +226,7 @@ namespace test7 {
     // we check the alignment attribute before we perform the auto
     // deduction.
     for (d alignas(1) : arr) {} // expected-error {{requires type for loop variable}}
-    for (e [[deprecated]] : arr) { e = 0; } // expected-warning{{use of the deprecated attribute is a C++14 extension}} expected-warning {{deprecated}} expected-note {{here}} expected-error {{requires type for loop variable}}
+    for (e [[deprecated]] : arr) { e = 0; } // expected-warning{{use of the 'deprecated' attribute is a C++14 extension}} expected-warning {{deprecated}} expected-note {{here}} expected-error {{requires type for loop variable}}
   }
 }
 
index 3bb42df499a852210b130ad634ee11c30966733c..811610f50974cd70964c48ce9b28c88ffae4d620 100644 (file)
@@ -4,7 +4,7 @@
 // warnings
 
 [[deprecated("1")]] int function_1();
-// expected-warning@-1 {{use of the deprecated attribute is a C++14 extension}}
+// expected-warning@-1 {{use of the 'deprecated' attribute is a C++14 extension}}
 
 [[gnu::deprecated("3")]] int function_3();