summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2008-03-25 18:36:32 +0000
committerNate Begeman <natebegeman@mac.com>2008-03-25 18:36:32 +0000
commitc506c781171aa416512c5524145363e905056b6f (patch)
tree9882fc7dca63d3aefc2444408824d76a67339490 /clang/lib
parent03851eb91f0a08ab2a38b48b03b486bb263b1f2c (diff)
downloadbcm5719-llvm-c506c781171aa416512c5524145363e905056b6f.tar.gz
bcm5719-llvm-c506c781171aa416512c5524145363e905056b6f.zip
Extend QualType::getAddressSpace to do the right thing for array types, and in
the future, RecordTypes. llvm-svn: 48784
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 02b5f31c874..eea285cf41a 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -808,14 +808,9 @@ Sema::ActOnDeclarator(Scope *S, Declarator &D, DeclTy *lastDecl) {
// This includes arrays of objects with address space qualifiers, but not
// automatic variables that point to other address spaces.
// ISO/IEC TR 18037 S5.1.2
- if (NewVD->hasLocalStorage()) {
- QualType AutoTy = NewVD->getCanonicalType();
- if (const ArrayType *AT = AutoTy->getAsArrayType())
- AutoTy = AT->getElementType().getCanonicalType();
- if (AutoTy.getAddressSpace() != 0) {
- Diag(D.getIdentifierLoc(), diag::err_as_qualified_auto_decl);
- InvalidDecl = true;
- }
+ if (NewVD->hasLocalStorage() && (NewVD->getType().getAddressSpace() != 0)) {
+ Diag(D.getIdentifierLoc(), diag::err_as_qualified_auto_decl);
+ InvalidDecl = true;
}
// Merge the decl with the existing one if appropriate. If the decl is
// in an outer scope, it isn't the same thing.
OpenPOWER on IntegriCloud