================
@@ -0,0 +1,112 @@
+// RUN: %clang_cc1 -fsycl-is-device -std=c++17 -fsyntax-only -verify -DCPP17 %s
+// RUN: %clang_cc1 -fsycl-is-device -std=c++20 -fsyntax-only -verify -DCPP20 %s
+
+// Semantic tests for the sycl_external attribute.
+
+// expected-error@+1{{'sycl_external' can only be applied to functions with 
external linkage}}
+[[clang::sycl_external]]
+static void func1() {}
+
+// expected-error@+2{{'sycl_external' can only be applied to functions with 
external linkage}}
+namespace {
+  [[clang::sycl_external]]
+  void func2() {}
+
+  struct UnnX {};
+}
+
+// expected-error@+2{{'sycl_external' can only be applied to functions with 
external linkage}}
+namespace { struct S4 {}; }
+[[clang::sycl_external]] void func4(S4) {}
+
+// FIXME: This case is currently being diagnosed as an error because clang 
implements
+// default inheritance of attribute and explicit instantiation declaration 
names the
+// symbol that causes the instantiated specialization to have internal linkage.
----------------
schittir wrote:

I see. Thank you for clarifying it with the text from spec for the other case. 

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

Reply via email to