From: Samuel Just Date: Mon, 18 May 2020 18:03:36 +0000 (-0700) Subject: errorator: don't rely on non-evaluation of static_assert in constexpr branch X-Git-Tag: v17.0.0~2328^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=eecc61f3c9be13aa9dadf3f0790ab757d8ac7779;p=ceph.git 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 --- 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"); } }; }