diff options
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.td | 2 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 3 | ||||
| -rw-r--r-- | clang/test/Sema/attr-mode.c | 4 |
3 files changed, 4 insertions, 5 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index a8292a85e71..5fe82acf16c 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/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/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index d89365c2080..d5844f4dbc5 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/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/clang/test/Sema/attr-mode.c b/clang/test/Sema/attr-mode.c index f8cc4dc6486..9791826e1b1 100644 --- a/clang/test/Sema/attr-mode.c +++ b/clang/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}} |

