Skip to content

Commit d20f36c

Browse files
committed
update patch and tests
1 parent 501b219 commit d20f36c

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11431,7 +11431,7 @@ def err_invalid_std_type_in_sycl_kernel : Error<"%0 is an invalid kernel name, "
1143111431
"%q1 is declared in the 'std' namespace ">;
1143211432

1143311433
def err_sycl_kernel_incorrectly_named : Error<
11434-
"%select{%1 should be globally-visible"
11434+
"%select{%1 should be globally visible"
1143511435
"|unscoped enum %1 requires fixed underlying type"
1143611436
"|unnamed type %1 is not valid in a SYCL kernel name, provide a kernel name "
1143711437
"or enable unnamed kernel lambdas via -fsycl-unnamed-lambda"

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3657,7 +3657,7 @@ class SYCLKernelNameTypeVisitor
36573657
if (const auto *ED = dyn_cast<EnumDecl>(DeclNamed)) {
36583658
if (!ED->isScoped() && !ED->isFixed()) {
36593659
S.Diag(KernelInvocationFuncLoc, diag::err_sycl_kernel_incorrectly_named)
3660-
<< /* Unscoped enum requires fixed underlying type */ 1
3660+
<< /* unscoped enum requires fixed underlying type */ 1
36613661
<< DeclNamed;
36623662
IsInvalid = true;
36633663
}
@@ -3690,8 +3690,8 @@ class SYCLKernelNameTypeVisitor
36903690
if (UnnamedLambdaUsed) {
36913691
S.Diag(KernelInvocationFuncLoc,
36923692
diag::err_sycl_kernel_incorrectly_named)
3693-
<< /* unnamed type is not valid in a SYCL kernel name */ 2
3694-
<< KernelNameType;
3693+
<< /* unnamed type is not valid in a SYCL kernel name */ 2
3694+
<< KernelNameType;
36953695
IsInvalid = true;
36963696
return;
36973697
}

clang/test/SemaSYCL/implicit_kernel_type.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ int main() {
2323
queue q;
2424

2525
#if defined(WARN)
26-
// expected-error@#KernelSingleTask {{'InvalidKernelName1' should be globally-visible}}
26+
// expected-error@#KernelSingleTask {{'InvalidKernelName1' should be globally visible}}
2727
// expected-note@+7 {{in instantiation of function template specialization}}
2828
#elif defined(ERROR)
29-
// expected-error@#KernelSingleTask {{'InvalidKernelName1' should be globally-visible}}
29+
// expected-error@#KernelSingleTask {{'InvalidKernelName1' should be globally visible}}
3030
// expected-note@+4 {{in instantiation of function template specialization}}
3131
#endif
3232
class InvalidKernelName1 {};

clang/test/SemaSYCL/nested-anon-and-std-ns.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct MyWrapper {
3737
h.single_task<ValidNS::StructinValidNS>([] {});
3838
});
3939

40-
// expected-error@#KernelSingleTask {{'ParentStruct::ChildStruct' should be globally-visible}}
40+
// expected-error@#KernelSingleTask {{'ParentStruct::ChildStruct' should be globally visible}}
4141
// expected-note@+2{{in instantiation of function template specialization}}
4242
q.submit([&](cl::sycl::handler &h) {
4343
h.single_task<ParentStruct::ChildStruct>([] {});

clang/test/SemaSYCL/unnamed-kernel.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,27 @@ struct MyWrapper {
3232
public:
3333
void test() {
3434
cl::sycl::queue q;
35-
// expected-error@#KernelSingleTask {{'InvalidKernelName1' should be globally-visible}}
35+
// expected-error@#KernelSingleTask {{'InvalidKernelName1' should be globally visible}}
3636
// expected-note@+3{{in instantiation of function template specialization}}
3737
class InvalidKernelName1 {};
3838
q.submit([&](cl::sycl::handler &h) {
3939
h.single_task<InvalidKernelName1>([] {});
4040
});
4141

42-
// expected-error@#KernelSingleTask {{'namespace1::KernelName<InvalidKernelName2>' should be globally-visible}}
42+
// expected-error@#KernelSingleTask {{'namespace1::KernelName<InvalidKernelName2>' should be globally visible}}
4343
// expected-note@+3{{in instantiation of function template specialization}}
4444
class InvalidKernelName2 {};
4545
q.submit([&](cl::sycl::handler &h) {
4646
h.single_task<namespace1::KernelName<InvalidKernelName2>>([] {});
4747
});
4848

49-
// expected-error@#KernelSingleTask {{'MyWrapper::InvalidKernelName0' should be globally-visible}}
49+
// expected-error@#KernelSingleTask {{'MyWrapper::InvalidKernelName0' should be globally visible}}
5050
// expected-note@+2{{in instantiation of function template specialization}}
5151
q.submit([&](cl::sycl::handler &h) {
5252
h.single_task<InvalidKernelName0>([] {});
5353
});
5454

55-
// expected-error@#KernelSingleTask {{'namespace1::KernelName<MyWrapper::InvalidKernelName3>' should be globally-visible}}
55+
// expected-error@#KernelSingleTask {{'namespace1::KernelName<MyWrapper::InvalidKernelName3>' should be globally visible}}
5656
// expected-note@+2{{in instantiation of function template specialization}}
5757
q.submit([&](cl::sycl::handler &h) {
5858
h.single_task<namespace1::KernelName<InvalidKernelName3>>([] {});
@@ -63,26 +63,26 @@ struct MyWrapper {
6363
h.single_task<ValidAlias>([] {});
6464
});
6565

66-
// expected-error@#KernelSingleTask {{'MyWrapper::InvalidKernelName4' should be globally-visible}}
66+
// expected-error@#KernelSingleTask {{'std::max_align_t' is an invalid kernel name, 'std::(anonymous)' is declared in the 'std' namespace}}
6767
// expected-note@+2{{in instantiation of function template specialization}}
6868
q.submit([&](cl::sycl::handler &h) {
6969
h.single_task<std::max_align_t>([] {});
7070
});
7171

7272
using InvalidAlias = InvalidKernelName4;
73-
// expected-error@#KernelSingleTask {{'std::max_align_t' is an invalid kernel name, 'std::(anonymous)' is declared in the 'std' namespace}}
73+
// expected-error@#KernelSingleTask {{'MyWrapper::InvalidKernelName4' should be globally visible}}
7474
// expected-note@+2{{in instantiation of function template specialization}}
7575
q.submit([&](cl::sycl::handler &h) {
7676
h.single_task<InvalidAlias>([] {});
7777
});
7878

7979
using InvalidAlias1 = InvalidKernelName5;
80-
// expected-error@#KernelSingleTask {{'namespace1::KernelName<MyWrapper::InvalidKernelName5>' should be globally-visible}}
80+
// expected-error@#KernelSingleTask {{'namespace1::KernelName<MyWrapper::InvalidKernelName5>' should be globally visible}}
8181
// expected-note@+2{{in instantiation of function template specialization}}
8282
q.submit([&](cl::sycl::handler &h) {
8383
h.single_task<namespace1::KernelName<InvalidAlias1>>([] {});
8484
});
85-
// expected-error@#KernelSingleTask {{'Templated_kernel_name2<Templated_kernel_name<InvalidKernelName1>>' should be globally-visible}}
85+
// expected-error@#KernelSingleTask {{'Templated_kernel_name2<Templated_kernel_name<InvalidKernelName1>>' should be globally visible}}
8686
// expected-note@+2{{in instantiation of function template specialization}}
8787
q.submit([&](cl::sycl::handler &h) {
8888
h.single_task<Templated_kernel_name2<Templated_kernel_name<InvalidKernelName1>>>([] {});

0 commit comments

Comments
 (0)