================
@@ -12251,6 +12264,9 @@ bool Sema::CheckFunctionDeclaration(Scope *S, 
FunctionDecl *NewFD,
   if (NewFD->hasAttr<SYCLKernelEntryPointAttr>())
     SYCL().CheckSYCLEntryPointFunctionDecl(NewFD);
 
+  if (NewFD->hasAttr<SYCLExternalAttr>())
+    SYCL().CheckSYCLExternalFunctionDecl(NewFD);
----------------
tahonermann wrote:

We'll add tests to make sure the attribute has the proper affect with regard to 
actually emitting symbols. Tests for diagnostics are already in place in 
`clang/test/SemaSYCL/sycl-external-attr.cpp`.

Though, hmm, I think we're missing a test for implicit instantiation; I don't 
think we should diagnose cases like this:
```
namespace { struct S9 {}; }
struct T9 {
  using type = S9;
};
template<typename>
[[clang::sycl_external]] void func9() {}
template<typename T>
[[clang::sycl_external]] void test_func9() {
  func9<typename T::type>();
}
template void test_func9<T9>(); // Ok; don't diagnose implicit instantiation of 
func9<S9>().
```

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