diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2013-07-23 14:54:24 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2013-07-23 14:54:24 +0000 |
| commit | bcee83e99d8bfcfc74174db112de9191c5732c04 (patch) | |
| tree | 2b57675bcf082d09414913fddda071be92a75c03 /clang | |
| parent | 29982275012f1cfb6b9bd0b4934c2497b71ab276 (diff) | |
| download | bcm5719-llvm-bcee83e99d8bfcfc74174db112de9191c5732c04.tar.gz bcm5719-llvm-bcee83e99d8bfcfc74174db112de9191c5732c04.zip | |
Removed a redundant diagnostic and replaced it with a more standard one. Added a test case for the diagnostic.
llvm-svn: 186942
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.td | 2 | ||||
| -rw-r--r-- | clang/lib/Sema/SemaType.cpp | 4 | ||||
| -rw-r--r-- | clang/test/Sema/address_spaces.c | 1 |
3 files changed, 3 insertions, 4 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 3f63a50f56c..2e4917e9385 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -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< diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index 2e7f0acc1f7..d47cb9b386b 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -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; } diff --git a/clang/test/Sema/address_spaces.c b/clang/test/Sema/address_spaces.c index ebc510134b3..69e0b2851dc 100644 --- a/clang/test/Sema/address_spaces.c +++ b/clang/test/Sema/address_spaces.c @@ -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}} |

