Related to #33550 (comment)
Works around Clang code generation bug when targeting Windows where where catching const char*
exceptions by reference is broken, see https://github.com/mstorsjo/llvm-mingw/issues/522
Following C++ Core Guidelines E.15 “Throw by value, catch exceptions from a hierarchy by reference”, we throw std::string_view
instead of string literals.
Note that clang-tidy mentions string literals not being flagged, but it’s still an llvm-mingw
issue so we need to adjust anyway.
Array-to-pointer conversion makes string literal exceptions particularly fragile across platforms.
Also deleted HasReason::operator()(const char*)
to prevent future reliance on string literal exception handling.
The error was reproduced by adding a temporary nightly build pointing to https://github.com/l0rinc/bitcoin/pull/44. On master
the failure can be seen in https://github.com/l0rinc/bitcoin-core-nightly/pull/2