From 750f73aadcfb9810a5825fd57325e310042e5617 Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Tue, 30 Jul 2013 14:29:12 +0000 Subject: [PATCH] err_attribute_missing_parameter_name has been replaced by err_attribute_argument_type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187420 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticSemaKinds.td | 2 -- lib/Sema/SemaDeclAttr.cpp | 3 ++- test/Sema/attr-mode.c | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index a8292a85e7..5fe82acf16 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -1765,8 +1765,6 @@ def err_suppress_autosynthesis : Error< "to a class declaration">; def err_attribute_too_few_arguments : Error< "attribute takes at least %0 argument%s0">; -def err_attribute_missing_parameter_name : Error< - "attribute requires unquoted parameter">; def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">; def err_attribute_bad_neon_vector_size : Error< "Neon vector size must be 64 or 128 bits">; diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index d89365c208..d5844f4dbc 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -3514,7 +3514,8 @@ static void handleModeAttr(Sema &S, Decl *D, const AttributeList &Attr) { IdentifierInfo *Name = Attr.getParameterName(); if (!Name) { - S.Diag(Attr.getLoc(), diag::err_attribute_missing_parameter_name); + S.Diag(Attr.getLoc(), diag::err_attribute_argument_type) << Attr.getName() + << AANT_ArgumentIdentifier; return; } diff --git a/test/Sema/attr-mode.c b/test/Sema/attr-mode.c index f8cc4dc648..9791826e1b 100644 --- a/test/Sema/attr-mode.c +++ b/test/Sema/attr-mode.c @@ -13,8 +13,8 @@ int i16_2_test[sizeof(i16_1) == 2 ? 1 : -1]; typedef float f64 __attribute((mode(DF))); int f64_test[sizeof(f64) == 8 ? 1 : -1]; -typedef int invalid_1 __attribute((mode)); // expected-error{{attribute requires unquoted parameter}} -typedef int invalid_2 __attribute((mode())); // expected-error{{attribute requires unquoted parameter}} +typedef int invalid_1 __attribute((mode)); // expected-error{{'mode' attribute requires an identifier}} +typedef int invalid_2 __attribute((mode())); // expected-error{{'mode' attribute requires an identifier}} typedef int invalid_3 __attribute((mode(II))); // expected-error{{unknown machine mode}} typedef struct {int i,j,k;} invalid_4 __attribute((mode(SI))); // expected-error{{mode attribute only supported for integer and floating-point types}} typedef float invalid_5 __attribute((mode(SI))); // expected-error{{type of machine mode does not match type of base type}} -- 2.40.0