rjmccall added inline comments.

================
Comment at: lib/Sema/SemaDecl.cpp:7210
+      return;
+    }
   }
----------------
err_opencl_function_variable seems like a better diagnostic, at least for 
opencl_global.  You can fall back on this more general diagnostic for other 
address spaces.

I think you can just assert here that T.getAddressSpace() != 
LangAS::opencl_constant instead of checking it.

Thinking about it, it feels like opencl_local should be handled the same way: 
they shouldn't get here because they don't really have automatic storage 
duration.  They're much more like a thread-local than an actual local.  
However, we can tackle that some other time.


https://reviews.llvm.org/D32248



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

Reply via email to