r199906 - Allow clang to compile the "extern" storage class in OpenCL 1.2.

Joey Gouly joey.gouly at arm.com
Thu Jan 23 08:38:36 PST 2014


You forgot the tests :)

-----Original Message-----
From: cfe-commits-bounces at cs.uiuc.edu
[mailto:cfe-commits-bounces at cs.uiuc.edu] On Behalf Of Pekka Jaaskelainen
Sent: 23 January 2014 16:21
To: cfe-commits at cs.uiuc.edu
Subject: r199906 - Allow clang to compile the "extern" storage class in
OpenCL 1.2.

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=1999
06&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;


_______________________________________________
cfe-commits mailing list
cfe-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits








More information about the cfe-commits mailing list