diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2015-02-16 23:12:37 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2015-02-16 23:12:37 +0000 |
| commit | f25731a4b45bf9813afc7fd65cf2b220cc2a7227 (patch) | |
| tree | 0d6fa3b116ca4e8661d145e93edc1dd360e7f714 /clang | |
| parent | f83bd0341d92c54a85a3e150ee067ef7c7be937a (diff) | |
| download | bcm5719-llvm-f25731a4b45bf9813afc7fd65cf2b220cc2a7227.tar.gz bcm5719-llvm-f25731a4b45bf9813afc7fd65cf2b220cc2a7227.zip | |
Minor tweaks to r229447 to ensure the attribute is properly quoted when diagnosed.
llvm-svn: 229454
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.td | 5 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 2 | ||||
| -rw-r--r-- | clang/test/Parser/cxx0x-attributes.cpp | 8 | ||||
| -rw-r--r-- | clang/test/SemaCXX/for-range-examples.cpp | 4 | ||||
| -rw-r--r-- | clang/test/SemaCXX/generalized-deprecated.cpp | 2 |
5 files changed, 10 insertions, 11 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index b2cb545a090..d979fe1cbe1 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -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< diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 42cfd9afa01..4abe480c52b 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -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); } diff --git a/clang/test/Parser/cxx0x-attributes.cpp b/clang/test/Parser/cxx0x-attributes.cpp index ab0ce192fca..33987f94c2e 100644 --- a/clang/test/Parser/cxx0x-attributes.cpp +++ b/clang/test/Parser/cxx0x-attributes.cpp @@ -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(); } diff --git a/clang/test/SemaCXX/for-range-examples.cpp b/clang/test/SemaCXX/for-range-examples.cpp index f2b155ad7e5..9359ae63a60 100644 --- a/clang/test/SemaCXX/for-range-examples.cpp +++ b/clang/test/SemaCXX/for-range-examples.cpp @@ -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}} } } diff --git a/clang/test/SemaCXX/generalized-deprecated.cpp b/clang/test/SemaCXX/generalized-deprecated.cpp index 3bb42df499a..811610f5097 100644 --- a/clang/test/SemaCXX/generalized-deprecated.cpp +++ b/clang/test/SemaCXX/generalized-deprecated.cpp @@ -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(); |

