diff options
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 20c1b1015e..2416f39442 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -10144,6 +10144,12 @@ FieldDecl *Sema::HandleField(Scope *S, RecordDecl *Record, } } + // TR 18037 does not allow fields to be declared with address spaces. + if (T.getQualifiers().hasAddressSpace()) { + Diag(Loc, diag::err_field_with_address_space); + D.setInvalidType(); + } + // OpenCL 1.2 spec, s6.9 r: // The event type cannot be used to declare a structure or union field. if (LangOpts.OpenCL && T->isEventT()) { @@ -10151,12 +10157,11 @@ FieldDecl *Sema::HandleField(Scope *S, RecordDecl *Record, D.setInvalidType(); } - DiagnoseFunctionSpecifiers(D); if (D.getDeclSpec().isThreadSpecified()) Diag(D.getDeclSpec().getThreadSpecLoc(), diag::err_invalid_thread); - + // Check to see if this name was declared as a member previously NamedDecl *PrevDecl = 0; LookupResult Previous(*this, II, Loc, LookupMemberName, ForRedeclaration); |