Removed a redundant diagnostic and replaced it with a more standard one. Added a...
authorAaron Ballman <aaron@aaronballman.com>
Tue, 23 Jul 2013 14:54:24 +0000 (14:54 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Tue, 23 Jul 2013 14:54:24 +0000 (14:54 +0000)
llvm-svn: 186942

clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaType.cpp
clang/test/Sema/address_spaces.c

index 3f63a50..2e4917e 100644 (file)
@@ -1837,8 +1837,6 @@ def err_ext_vector_component_exceeds_length : Error<
   "vector component access exceeds type %0">;
 def err_ext_vector_component_name_illegal : Error<
   "illegal vector component name '%0'">;
-def err_attribute_address_space_not_int : Error<
-  "address space attribute requires an integer constant">;
 def err_attribute_address_space_negative : Error<
   "address space is negative">;
 def err_attribute_address_space_too_high : Error<
index 2e7f0ac..d47cb9b 100644 (file)
@@ -3840,8 +3840,8 @@ static void HandleAddressSpaceTypeAttribute(QualType &Type,
   llvm::APSInt addrSpace(32);
   if (ASArgExpr->isTypeDependent() || ASArgExpr->isValueDependent() ||
       !ASArgExpr->isIntegerConstantExpr(addrSpace, S.Context)) {
-    S.Diag(Attr.getLoc(), diag::err_attribute_address_space_not_int)
-      << ASArgExpr->getSourceRange();
+    S.Diag(Attr.getLoc(), diag::err_attribute_argument_not_int)
+      << Attr.getName()->getName() << ASArgExpr->getSourceRange();
     Attr.setInvalid();
     return;
   }
index ebc5101..69e0b28 100644 (file)
@@ -66,3 +66,4 @@ void access_as_field()
 }
 
 typedef int PR4997 __attribute__((address_space(Foobar))); // expected-error {{use of undeclared identifier 'Foobar'}}
+__attribute__((address_space("12"))) int *i; // expected-error {{'address_space' attribute requires integer constant}}