Anastasia added inline comments.

================
Comment at: clang/lib/Sema/SemaDecl.cpp:9972
     // OpenCL v1.2 s6.8 static is invalid for kernel functions.
-    if ((getLangOpts().OpenCLVersion >= 120)
-        && (SC == SC_Static)) {
+    if ((getLangOpts().getOpenCLCompatibleVersion() >= 120) &&
+        (SC == SC_Static)) {
----------------
I wonder though if we should just drop a version check here completely.

I don't think we can allow this in the earlier OpenCL versions. The reason why 
it doesn't apply to earlier versions is that `static`/`extern` wasn't allowed 
at all so presumably frontend would reject such a case earlier.

I think the extra check is not doing anything useful here, but only adds extra 
code to read and maintain.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109150/new/

https://reviews.llvm.org/D109150

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to