D.getDeclSpec().isInlineSpecified(),
LastDeclarator);
// Handle attributes.
-
HandleDeclAttributes(NewFD, D.getDeclSpec().getAttributes(),
D.getAttributes());
// Handle attributes prior to checking for duplicates in MergeVarDecl
HandleDeclAttributes(NewVD, D.getDeclSpec().getAttributes(),
D.getAttributes());
-
+ // Emit a warning (error?) if an address space was applied to decl with
+ // local storage.
+ if (NewVD->hasLocalStorage() &&
+ (NewVD->getCanonicalType().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.
if (PrevDecl && S->isDeclScope(PrevDecl)) {
"address space attribute requires an integer constant")
DIAG(err_attribute_address_multiple_qualifiers, ERROR,
"multiple address spaces specified for type")
+DIAG(err_as_qualified_auto_decl, ERROR,
+ "automatic variable qualified with an address space")
DIAG(err_attribute_annotate_no_string, ERROR,
"argument to annotate attribute was not a string literal")
DIAG(warn_attribute_ignored, WARNING,
int _AS1 _AS2 *Y; // expected-error {{multiple address spaces specified for type}}
int *_AS1 _AS2 *Z; // expected-error {{multiple address spaces specified for type}}
+ _AS1 int local; // expected-error {{automatic variable qualified with an address space}}
+
*a = 5.0f;
}