================
@@ -12053,6 +12053,10 @@ bool Sema::CheckFunctionDeclaration(Scope *S, 
FunctionDecl *NewFD,
   if (LangOpts.OpenMP)
     OpenMP().ActOnFinishedFunctionDefinitionInOpenMPAssumeScope(NewFD);
 
+  if (LangOpts.isSYCL() && NewFD->hasAttr<SYCLKernelEntryPointAttr>() &&
+      !NewFD->isInvalidDecl() && !NewFD->isDependentContext())
----------------
tahonermann wrote:

The call to `llvm::report_fatal_error()` will occur at run-time for Clang, 
sure, but that will be compile-time for users building their SYCL source code. 
I would rather have Clang fail with a stack trace that clearly indicates the 
problem (to us) then perform code gen thinking that a kernel was registered 
when one wasn't (likely to manifest in some kind of "kernel not found" error at 
run-time) or, worse, having a duplicate registration silently rejected such 
that an unintended kernel gets called. I grant that these scenarios will only 
occur if there are missing or incorrect checks elsewhere, but these kinds of 
problems would be rather painful to trace back to what the problem really is.

https://github.com/llvm/llvm-project/pull/111389
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to