Skip to content

Commit 5af8c43

Browse files
[SYCL] Fix is_error_code_enum template specialization. (#4225)
Signed-off-by: Chris Perkins <[email protected]>
1 parent 07189af commit 5af8c43

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

sycl/include/CL/sycl/exception.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,5 +202,5 @@ class __SYCL_EXPORT SYCLCategory : public std::error_category {
202202
} // __SYCL_INLINE_NAMESPACE(cl)
203203

204204
namespace std {
205-
template <> struct is_error_condition_enum<cl::sycl::errc> : true_type {};
205+
template <> struct is_error_code_enum<cl::sycl::errc> : true_type {};
206206
} // namespace std

sycl/test/basic_tests/exceptions-SYCL-2020.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ int main() {
7272
assert(std::string("SYCL").compare(ec.category().name()) == 0 &&
7373
"error code category name should be SYCL");
7474

75+
// Test enum
76+
static_assert(std::is_error_code_enum<sycl::errc>::value, "errc enum should identify as error code");
77+
static_assert(!std::is_error_condition_enum<sycl::errc>::value, "errc enum should not identify as error condition");
78+
7579
std::cout << "OK" << std::endl;
7680
return 0;
7781
}

0 commit comments

Comments
 (0)