From 29941be06db94345197e7f967625e15ff38bdda2 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 27 Oct 2023 10:37:08 -0700 Subject: [PATCH] Fix call to hasValue that isn't compatible with all LLVM versions Sometimes we use std::optional, sometimes we use LLVM optional; they have differently named methods. To avoid using method names in a non-portable way, use operator bool. Signed-off-by: Danila Fedorin --- frontend/include/chpl/resolution/can-pass.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/include/chpl/resolution/can-pass.h b/frontend/include/chpl/resolution/can-pass.h index 80a71f5718fe..ac5790a7fa48 100644 --- a/frontend/include/chpl/resolution/can-pass.h +++ b/frontend/include/chpl/resolution/can-pass.h @@ -142,7 +142,7 @@ class CanPassResult { bool passes() { return !failReason_; } PassingFailureReason reason() { - CHPL_ASSERT(failReason_.hasValue()); + CHPL_ASSERT((bool) failReason_); return *failReason_; }