diff options
author | Tanya Lattner <tonic@nondot.org> | 2009-09-30 20:47:43 +0000 |
---|---|---|
committer | Tanya Lattner <tonic@nondot.org> | 2009-09-30 20:47:43 +0000 |
commit | 27a84d01614609c094029a49f7a86f0f7f8fe7f1 (patch) | |
tree | b39f79c1fe1468dba7c0934d2ab87a703f326966 /lib | |
parent | 871dc3e2258e6161d0d22bbfbaf36f2accb25a2b (diff) |
Add an error for function parameters that have a qualified address space since this is not allowed by the embedded c extension spec.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 5df4dca860..37f8aed474 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -3632,7 +3632,18 @@ Sema::ActOnParamDeclarator(Scope *S, Declarator &D) { << D.getCXXScopeSpec().getRange(); New->setInvalidDecl(); } - + + // ISO/IEC TR 18037 S6.7.3: "The type of an object with automatic storage + // duration shall not be qualified by an address-space qualifier." + // Since all parameters have automatic store duration, they can not have + // an address space. + if (T.getAddressSpace() != 0) { + Diag(D.getIdentifierLoc(), + diag::err_arg_with_address_space); + New->setInvalidDecl(); + } + + // Add the parameter declaration into this scope. S->AddDecl(DeclPtrTy::make(New)); if (II) |