[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)
    Tom Honermann via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Wed Jul 23 10:35:42 PDT 2025
    
    
  
================
@@ -16275,6 +16297,13 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body,
     }
   }
 
+  if (FD && !FD->isInvalidDecl() && FD->hasAttr<SYCLExternalAttr>()) {
+    SYCLExternalAttr *SEAttr = FD->getAttr<SYCLExternalAttr>();
+    if (FD->isDeletedAsWritten())
----------------
tahonermann wrote:
Sindhu and I previously discussed that and concluded that would be undesirable in template scenarios. In non-dependent cases, diagnosing a defaulted-as-deleted case would probably be ok, but seemed enough of an edge case not to bother since an ODR-use of the deleted function would be diagnosed anyway.
https://github.com/llvm/llvm-project/pull/140282
    
    
More information about the cfe-commits
mailing list