diff options
author | Nate Begeman <natebegeman@mac.com> | 2008-03-25 18:36:32 +0000 |
---|---|---|
committer | Nate Begeman <natebegeman@mac.com> | 2008-03-25 18:36:32 +0000 |
commit | 8e7dafec4b70303dfaff95151cd06bfc5532720c (patch) | |
tree | 834ff5f234c78956634632aadc23f410fad41b17 /lib/Sema/SemaDecl.cpp | |
parent | 245f1b559e162e487c9f2c47778cbd150f32fd34 (diff) |
Extend QualType::getAddressSpace to do the right thing for array types, and in
the future, RecordTypes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48784 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 02b5f31c87..eea285cf41 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/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. |