Skip to content

Commit 0bc7e59

Browse files
authored
[SYCL] Initialize error code in sycl::exception (#12256)
If there is no backend specific error code associated with the sycl::exception then error code must be 0, so initialize with 0 by default, otherwise static analyzer complains about unitialized data member.
1 parent c4f1cee commit 0bc7e59

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sycl/include/sycl/exception.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class __SYCL_EXPORT exception : public virtual std::exception {
105105
// Exceptions must be noexcept copy constructible, so cannot use std::string
106106
// directly.
107107
std::shared_ptr<std::string> MMsg;
108-
pi_int32 MPIErr;
108+
pi_int32 MPIErr = 0;
109109
std::shared_ptr<context> MContext;
110110
std::error_code MErrC = make_error_code(sycl::errc::invalid);
111111

0 commit comments

Comments
 (0)