]> granicus.if.org Git - clang/commitdiff
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)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186942 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 3f63a50f56c6064fef2106cc33985dc26f214b9c..2e4917e938545a4375e4ea87ba6e1d60a9c33ee5 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 2e7f0acc1f75bd11adc9bbf6f8cb31b6c10867ce..d47cb9b386b293991e2f940aa38353d5dbd044a2 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 ebc510134b3129c6d32277f2a7f066b61d0dc4ff..69e0b2851dc33ac7d63e5d9f4026fbf700f37c70 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}}