|
@@ -9469,8 +9469,12 @@ ParmVarDecl *Sema::CheckParameter(DeclContext *DC, SourceLocation StartLoc,
|
|
|
// Since all parameters have automatic store duration, they can not have
|
|
|
// an address space.
|
|
|
if (T.getAddressSpace() != 0) {
|
|
|
- Diag(NameLoc, diag::err_arg_with_address_space);
|
|
|
- New->setInvalidDecl();
|
|
|
+ // OpenCL allows function arguments declared to be an array of a type
|
|
|
+ // to be qualified with an address space.
|
|
|
+ if (!(getLangOpts().OpenCL && T->isArrayType())) {
|
|
|
+ Diag(NameLoc, diag::err_arg_with_address_space);
|
|
|
+ New->setInvalidDecl();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return New;
|