Skip to content

Commit d5ee341

Browse files
committed
Undo accidental delete and add a virtual function case
1 parent 86e7728 commit d5ee341

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

clang/test/SemaSYCL/sycl-external-attr.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ template<typename>
2929
[[clang::sycl_external]] void func6() {}
3030
template void func6<S6>();
3131

32+
// FIXME: C++23 [temp.expl.spec]p12 states:
33+
// ... Similarly, attributes appearing in the declaration of a template
34+
// have no effect on an explicit specialization of that template.
35+
// Clang currently instantiates and propagates attributes from a function
36+
// template to its explicit specializations resulting in the following
37+
// spurious error.
3238
// expected-error@+3{{'clang::sycl_external' can only be applied to functions with external linkage}}
3339
namespace { struct S7 {}; }
3440
template<typename>
@@ -126,6 +132,7 @@ class B {
126132

127133
[[clang::sycl_external]] virtual void bar() = 0;
128134
};
135+
[[clang::sycl_external]] void B::bar() {}
129136

130137
[[clang::sycl_external]] constexpr int square(int x);
131138

0 commit comments

Comments
 (0)