diff --git a/onnxruntime/core/platform/env.cc b/onnxruntime/core/platform/env.cc index 6726f7c3b7efc..bb34e02e7c113 100644 --- a/onnxruntime/core/platform/env.cc +++ b/onnxruntime/core/platform/env.cc @@ -47,7 +47,7 @@ std::pair GetErrnoInfo() { #else // strerror_r return type differs by platform. auto ret = strerror_r(err, buf, sizeof(buf)); - if (std::is_same_v) { // POSIX returns int + if constexpr (std::is_same_v) { // POSIX returns int msg = ret == 0 ? buf : "Failed to get error message"; } else { // GNU returns char*