Skip to content

Commit 675f9ff

Browse files
author
Victor Lomuller
committed
address review comments
1 parent 6cf6a96 commit 675f9ff

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12491,7 +12491,7 @@ def err_sycl_wg_scope : Error<
1249112491
"SYCL work group scope only applies to class with a trivial "
1249212492
"%select{default constructor|destructor}0">;
1249312493
def err_sycl_field_with_wg_scope : Error<
12494-
"type with a SYCL work group scope attribute cannot be used with a non-static data members">;
12494+
"non-static data member is of a type with a SYCL work group scope attribute applied to it">;
1249512495
def err_sycl_virtual_types : Error<
1249612496
"no class with a vtable can be used in a SYCL kernel or any code included in the kernel">;
1249712497
def note_sycl_recursive_function_declared_here: Note<"function implemented using recursion declared here">;

clang/lib/Sema/SemaDecl.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8665,12 +8665,9 @@ void Sema::CheckVariableDeclarationType(VarDecl *NewVD) {
86658665
// ISO/IEC TR 18037 S5.1.2
86668666
if (!getLangOpts().OpenCL && NewVD->hasLocalStorage() &&
86678667
T.getAddressSpace() != LangAS::Default) {
8668-
if (!getLangOpts().SYCLIsDevice &&
8669-
T.getAddressSpace() != LangAS::sycl_local) {
8670-
Diag(NewVD->getLocation(), diag::err_as_qualified_auto_decl) << 0;
8671-
NewVD->setInvalidDecl();
8672-
return;
8673-
}
8668+
Diag(NewVD->getLocation(), diag::err_as_qualified_auto_decl) << 0;
8669+
NewVD->setInvalidDecl();
8670+
return;
86748671
}
86758672

86768673
// OpenCL v1.2 s6.8 - The static qualifier is valid only in program

clang/test/SemaSYCL/sycl_wg_scope.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Verify the use of wg_scope is correctly diagnosed.
12
// RUN: %clang_cc1 -fsycl-is-device -verify %s
23

34
class [[__sycl_detail__::wg_scope]] G1 {};
@@ -65,14 +66,14 @@ B12<Valid> b12;
6566
B12<InvalidCtor> b13;
6667

6768
class B14 {
68-
G1 field; // expected-error {{type with a SYCL work group scope attribute cannot be used with a non-static data members}}
69+
G1 field; // expected-error {{non-static data member is of a type with a SYCL work group scope attribute applied to it}}
6970
};
7071

7172
template <typename T> class B15 {
7273
T field; // #B15-field
7374
};
7475

75-
// expected-error@#B15-field {{type with a SYCL work group scope attribute cannot be used with a non-static data members}}
76+
// expected-error@#B15-field {{non-static data member is of a type with a SYCL work group scope attribute applied to it}}
7677
// expected-note@+1 {{in instantiation of template class 'B15<G1>' requested here}}
7778
B15<G1> b15;
7879

sycl/doc/extensions/experimental/sycl_ext_oneapi_work_group_scratch_memory.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ then the implementation must throw a synchronous exception with the
151151
local memory into account, whether via the `work_group_scratch_size` property
152152
or other APIs such as `local_accessor`.
153153

154-
=== Example
154+
== Example
155155

156156
[source,c++]
157157
----

sycl/doc/extensions/experimental/sycl_ext_oneapi_work_group_static.asciidoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public:
116116
} // namespace sycl::ext::oneapi::experimental
117117
----
118118

119-
`T` must be a cv-unqualified trivially constructible and trivially destructible.
119+
`T` must be cv-unqualified, trivially constructible and trivially destructible.
120120

121121
The storage for the object is allocated in device local memory before
122122
calling the user's kernel lambda, and deallocated when all work-items
@@ -188,7 +188,7 @@ then the implementation must throw a synchronous exception with the
188188
local memory into account, whether via the `work_group_scratch_size` property
189189
or other APIs such as `local_accessor`.
190190

191-
=== Example
191+
== Example
192192

193193
[source,c++]
194194
----

0 commit comments

Comments
 (0)