[PATCH] D100471: [C++4OpenCL] Add extra diagnostics for kernel argument types

Ole Strohm via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 15 09:14:25 PDT 2021


olestrohm added inline comments.


================
Comment at: clang/lib/Sema/SemaDecl.cpp:8673
+    // reference if an implementation supports them in kernel parameters.
+    if (!PointeeType->isAtomicType() && !PointeeType->isVoidType() &&
+        !PointeeType->isStandardLayoutType())
----------------
Anastasia wrote:
> svenvh wrote:
> > I am wondering if this should be made conditional on C++ mode?  Or is there no possible way that this new `return InvalidKernelParam` can be triggered from OpenCL C mode?
> I think it shouldn't because C types are POD types which is a superset of standard layout types.
> 
I believe these rules are correct, but just in case they are not, I will make it conditional on C++ mode to not accidentally break OpenCL C.


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

https://reviews.llvm.org/D100471



More information about the cfe-commits mailing list