On Thu, 2022-03-31 at 17:50 +0200, Matthias Kretz via Gcc-patches wrote: > I like it. But I'd like it even more if we could have > > #elif defined _UBSAN > __ubsan_invoke_ub("reached std::unreachable()"); > > But to my knowledge UBSAN has no hooks for the library like this > (yet).
UBSAN can catch __builtin_unreachable() and print a message "execution reached an unreachable program point". -- Xi Ruoyao <xry...@mengyan1223.wang> School of Aerospace Science and Technology, Xidian University