Skip to content

Commit a9aafb0

Browse files
author
Chen, Brox
committed
address void pointer and test issue
1 parent 7295dd3 commit a9aafb0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sycl/include/sycl/ext/oneapi/experimental/annotated_ptr/annotated_ptr.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ __SYCL_TYPE(annotated_ptr) annotated_ptr<T, detail::properties_t<Props...>> {
238238
annotated_ptr(const annotated_ptr &) = default;
239239
annotated_ptr &operator=(const annotated_ptr &) = default;
240240

241-
static_assert(std::is_trivially_copyable_v<T>,
241+
static_assert(std::is_same_v<T, void> || std::is_trivially_copyable_v<T>,
242242
"encapsulating annotated_ptr with non-trivially-copyable is "
243243
"not supported!");
244244

sycl/test/extensions/annotated_ptr/annotated_ptr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ void TestVectorAddWithAnnotatedMMHosts() {
164164
test(int n_) : n(n_) {}
165165
test(const test &t) { n = t.n; }
166166
};
167-
// expected-warning@+1 {{T is non-trivially copyable type, some operatorsmight invoke the copy constructor}}
167+
// expected-error@+1 {{encapsulating annotated_ptr with non-trivially-copyable is not supported}}
168168
annotated_ptr<test> non_trivially_copyable;
169169

170170
free(raw, q);

0 commit comments

Comments
 (0)