r199906 - Allow clang to compile the "extern" storage class in OpenCL 1.2.
Pekka Jaaskelainen
pekka.jaaskelainen at tut.fi
Thu Jan 23 08:21:02 PST 2014
Author: pjaaskel
Date: Thu Jan 23 10:21:02 2014
New Revision: 199906
URL: http://llvm.org/viewvc/llvm-project?rev=199906&view=rev
Log:
Allow clang to compile the "extern" storage class in OpenCL 1.2.
Patch from Fraser Cormack!
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=199906&r1=199905&r2=199906&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Thu Jan 23 10:21:02 2014
@@ -8541,7 +8541,7 @@ void Sema::ActOnUninitializedDecl(Decl *
// be initialized.
if (!Var->isInvalidDecl() &&
Var->getType().getAddressSpace() == LangAS::opencl_constant &&
- !Var->getInit()) {
+ Var->getStorageClass() != SC_Extern && !Var->getInit()) {
Diag(Var->getLocation(), diag::err_opencl_constant_no_init);
Var->setInvalidDecl();
return;
More information about the cfe-commits
mailing list