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

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 14 05:46:06 PDT 2021


Anastasia added inline comments.


================
Comment at: clang/test/SemaOpenCLCXX/invalid-kernel.clcpp:44
+kernel void trivial_v(Trivial in) {} //expected-error{{'__private Trivial' cannot be used as the type of a kernel parameter}}
+kernel void trivial_p(__global Trivial*__private in) {} //expected-error{{'__global Trivial *__private' cannot be used as the type of a kernel parameter}}
----------------
Let's also test atomic and void pointer type since you are checking it in your patch?

This should be extended to references btw since clang implements them as a pointer type so we can allow that too.

Similarly for by-value parameters - let's test an OpenCL type too. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100471



More information about the cfe-commits mailing list