From eecc61f3c9be13aa9dadf3f0790ab757d8ac7779 Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 18 May 2020 11:03:36 -0700 Subject: [PATCH] errorator: don't rely on non-evaluation of static_assert in constexpr branch At least in clang, we appear to fail that static assert even with another branch taken. Instead, assert that one of the other conditions is true. Signed-off-by: Samuel Just --- src/crimson/common/errorator.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/crimson/common/errorator.h b/src/crimson/common/errorator.h index b7a7c8eff0031..15fffbb0a4165 100644 --- a/src/crimson/common/errorator.h +++ b/src/crimson/common/errorator.h @@ -299,7 +299,9 @@ static constexpr auto composer(FuncHead&& head, FuncTail&&... tail) { std::forward(args)...); } else { static_assert( - _impl::always_false::value, "composition is not exhaustive"); + std::is_invocable_v || + (sizeof...(FuncTail) > 0), + "composition is not exhaustive"); } }; } -- 2.39.5