From 63317103c9f2b0635558da814567bb79c17ae851 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Mon, 16 Oct 2023 10:17:12 -0400 Subject: miniscript: make operator_mst consteval It seems modern compilers don't realize that all invocations of operator""_mst can be evaluated at compile time, despite the constexpr keyword. Since C++20, we can force them to evaluate at compile time, turning all the miniscript type constants into actual compile-time constants. It appears that MSVC does not support consteval operator"" when used inside certain expressions. For the few places where this happens, define a constant outside the operator call. Co-Authored-By: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> --- src/script/miniscript.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/script/miniscript.cpp') diff --git a/src/script/miniscript.cpp b/src/script/miniscript.cpp index 344a81bdf0..455bd56283 100644 --- a/src/script/miniscript.cpp +++ b/src/script/miniscript.cpp @@ -231,7 +231,8 @@ Type ComputeType(Fragment fragment, Type x, Type y, Type z, const std::vector