[clang] [clang][SYCL] Add sycl_external attribute and restrict emitting device code (PR #140282)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 14 08:15:24 PDT 2025
================
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// expected-warning at +1{{'clang::sycl_external' attribute ignored}}
+[[clang::sycl_external]] void bar() {}
+
+// expected-warning at +1{{'clang::sycl_external' attribute ignored}}
+[[clang::sycl_external]] int a;
+
+// expected-warning at +2{{'clang::sycl_external' attribute ignored}}
+namespace not_sycl {
+[[clang::sycl_external]] void foo() {}
+}
----------------
schittir wrote:
```
template<typename T>
[[clang::sycl_external]] void ft(T) {}
template void ft(int);
```
https://github.com/llvm/llvm-project/pull/140282
More information about the cfe-commits
mailing list