Skip to content

Commit 640d162

Browse files
committed
Apply CR suggestions
1 parent ebcc52c commit 640d162

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11632,7 +11632,7 @@ def ext_sycl_2020_attr_spelling : ExtWarn<
1163211632
InGroup<Sycl2017Compat>;
1163311633
def err_sycl_taking_address_of_wrong_function : Error<
1163411634
"taking address of a function not marked with "
11635-
"`intel::device_indirectly_callable attribute` is not allowed in SYCL device "
11635+
"'intel::device_indirectly_callable' attribute is not allowed in SYCL device "
1163611636
"code">;
1163711637

1163811638
// errors of expect.with.probability

clang/lib/Sema/SemaOverload.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1817,12 +1817,12 @@ static bool IsStandardConversion(Sema &S, Expr* From, QualType ToType,
18171817
// performed - it may end up here checking validity of a conversion.
18181818
// If false is returned from here, initialization sequence is marked as
18191819
// invalid, then checkAddressOfFunctionIsAvailable is called again
1820-
// to understand the reason of invaid initialization and and the end
1821-
// it is called with `Complain` parameter to emit diagnostics.
1820+
// to understand the reason of invaid initialization and in the end
1821+
// it is called with 'Complain' parameter to emit diagnostics.
18221822
// We cannot mark an initialization permanently invalid for SYCL device,
18231823
// because we may not know yet where the device code is.
1824-
// So, just call `checkAddressOfFunctionIsAvailable` again but with
1825-
// `Complain` parameter to issue a deferred diagnostic.
1824+
// So, just call 'checkAddressOfFunctionIsAvailable' again but with
1825+
// 'Complain' parameter to issue a deferred diagnostic.
18261826
if (S.getLangOpts().SYCLIsDevice)
18271827
S.checkAddressOfFunctionIsAvailable(FD, /*Complain=*/true,
18281828
DRE->getExprLoc());

clang/test/SemaSYCL/wrong-address-taking.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ template <typename Fn, typename... Args> void templateCaller(Fn F, Args... As) {
3030
}
3131

3232
template <auto Fn, typename... Args> void templateCaller1(Args... As) {
33-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
33+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
3434
Fn(As...);
35-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
35+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
3636
runFn(*Fn);
3737
}
3838

3939
template <auto Fn, typename... Args> void templateCaller2(Args... As) {
40-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
40+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
4141
Fn(As...);
4242
}
4343

4444
void basicUsage() {
45-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
45+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
4646
int (*p)(int) = &badFoo;
47-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
47+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
4848
int (*p2)(int) = badFoo;
4949
}
5050

@@ -68,32 +68,32 @@ int main() {
6868
// expected-note@#KernelSingleTaskKernelFuncCall 2{{called by 'kernel_single_task<Basic}}
6969
h.single_task<class Basic>(
7070
[=]() {
71-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
71+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
7272
int (*p)(int) = &badFoo;
73-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
73+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
7474
int (*p2)(int) = badFoo;
7575

7676
// OK
7777
int (*p3)(int) = &goodFoo;
7878
int (*p4)(int) = goodFoo;
7979

80-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
80+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
8181
auto p5 = &externalBadFoo;
8282
auto *p6 = &externalGoodFoo;
8383

8484
// Make sure that assignment is diagnosed correctly;
8585
int (*a)(int);
86-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
86+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
8787
a = badFoo;
88-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
88+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
8989
a = &badFoo;
9090

9191
a = goodFoo;
9292
a = &goodFoo;
9393

94-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
94+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
9595
constexpr auto b = badFoo;
96-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
96+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
9797
constexpr auto c = &badFoo;
9898
// expected-note@+1 {{called by 'operator()'}}
9999
basicUsage();
@@ -104,10 +104,10 @@ int main() {
104104
// expected-note@#KernelSingleTaskKernelFuncCall {{called by 'kernel_single_task<Members}}
105105
h.single_task<class Members>(
106106
[=]() {
107-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
107+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
108108
auto p = &ForMembers::badMember;
109109
auto p1 = &ForMembers::goodMember;
110-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
110+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
111111
auto *p2 = &ForMembers::badStaticMember;
112112
});
113113
});
@@ -116,24 +116,24 @@ int main() {
116116
// expected-note@#KernelSingleTaskKernelFuncCall 2{{called by 'kernel_single_task<RunVia}}
117117
h.single_task<class RunVia>(
118118
[=]() {
119-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
119+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
120120
int baz = runFn(badFoo);
121121

122122
baz = runFn(goodFoo);
123123

124-
// expected-error@+1 2{{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
124+
// expected-error@+1 2{{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
125125
baz = runFn1(badFoo);
126126

127127
baz = runFn1(goodFoo);
128128

129-
// expected-error@+1 2{{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
129+
// expected-error@+1 2{{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
130130
templateCaller(badFoo, 2);
131131
templateCaller(goodFoo, 1);
132132

133133
templateCaller1<goodFoo>(1);
134134

135135
// expected-note@+2 {{called by 'operator()'}}
136-
// expected-error@+1 {{taking address of a function not marked with `intel::device_indirectly_callable attribute` is not allowed in SYCL device code}}
136+
// expected-error@+1 {{taking address of a function not marked with 'intel::device_indirectly_callable' attribute is not allowed in SYCL device code}}
137137
templateCaller1<badFoo>(1);
138138

139139
});

0 commit comments

Comments
 (0)