[clang] [clang][SYCL] Diagnose reference kernel parameters (PR #192957)
Mariya Podchishchaeva via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 29 03:58:15 PDT 2026
================
@@ -665,6 +666,109 @@ OutlinedFunctionDecl *BuildSYCLKernelEntryPointOutline(Sema &SemaRef,
return OFD;
}
+class KernelParamsChecker : public ConstSubobjectVisitor<KernelParamsChecker> {
+ SemaSYCL &SemaSYCLRef;
+ bool IsValid = true;
+ using ObjectAccess =
+ llvm::PointerUnion<const ParmVarDecl *, const CXXBaseSpecifier *,
+ const FieldDecl *>;
+ SmallVector<ObjectAccess, 4> ObjectAccessPath;
+
+ void emitObjectAccessPathNotes() {
+ for (auto Parent : llvm::reverse(ObjectAccessPath)) {
+ if (auto *FD = Parent.dyn_cast<const FieldDecl *>()) {
----------------
Fznamznon wrote:
Yeah, same here as well
https://github.com/llvm/llvm-project/pull/192957
More information about the cfe-commits
mailing list