diff options
Diffstat (limited to 'lib/Sema')
-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. |