[clang] [clang][SYCL] Diagnose reference kernel arguments (PR #192957)
Mariya Podchishchaeva via cfe-commits
cfe-commits at lists.llvm.org
Fri May 22 09:46:03 PDT 2026
================
@@ -0,0 +1,93 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++17 -fsyntax-only -Wno-vla-cxx-extension -fsycl-is-host -verify %s
+// RUN: %clang_cc1 -triple spirv64 -std=c++17 -fsyntax-only -Wno-vla-cxx-extension -fsycl-is-device -verify %s
+
+// A unique kernel name type is required for each declared kernel entry point.
+template<int, int = 0> struct KN;
+
+// A generic kernel launch function.
+template<typename KNT, typename... Ts>
+void sycl_kernel_launch(const char *, Ts...) {}
+
+// Kernel entry point template definition.
+template<typename KNT, typename T>
+[[clang::sycl_kernel_entry_point(KNT)]]
+void kernel_single_task(T) {}
+
+struct S { // expected-note 3{{within field of type 'S' declared here}}
----------------
Fznamznon wrote:
I would avoid doing this in this PR since this diagnostic is used for OpenCL and other SYCL diagnostics that we implemented earlier. I can do that in a separate PR.
https://github.com/llvm/llvm-project/pull/192957
More information about the cfe-commits
mailing list