const DeclSpec &DS = D.getDeclSpec();
// Verify C99 6.7.5.3p2: The only SCS allowed is 'register'.
- if (DS.getStorageClassSpec() != DeclSpec::SCS_unspecified &&
- DS.getStorageClassSpec() != DeclSpec::SCS_register) {
+ VarDecl::StorageClass StorageClass = VarDecl::None;
+ if (DS.getStorageClassSpec() == DeclSpec::SCS_register) {
+ StorageClass = VarDecl::Register;
+ } else if (DS.getStorageClassSpec() != DeclSpec::SCS_unspecified) {
Diag(DS.getStorageClassSpecLoc(),
diag::err_invalid_storage_class_in_func_decl);
D.getMutableDeclSpec().ClearStorageClassSpecs();
ParmVarDecl *New = ParmVarDecl::Create(Context, CurContext,
D.getIdentifierLoc(), II,
- parmDeclType, VarDecl::None,
+ parmDeclType, StorageClass,
0, 0);
if (D.getInvalidType())
int *_dummy1 = &(arr + 1); // expected-error {{address expression must be an lvalue or a function designator}}
}
+void f6(register int x) {
+ int * dummy0 = &x; // expected-error {{address of register variable requested}}
+}