[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 23 06:10:53 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())
----------------
erichkeane wrote:

What about having this on otherwise deleted things?  We probably want to diagnose/do something in those cases as well?  Consider when it is put on a destructor that is defaulted, but implicitly deleted.

https://github.com/llvm/llvm-project/pull/140282


More information about the cfe-commits mailing list