I have seen this question which is about emulating __builtin_unreachable
in an older version of GCC. My question is exactly that, but for Visual Studio (2019). Does Visual Studio have some equivalent of __builtin_unreachable
? Is it possible to emulate it?
MSVC has the __assume
builtin which can be used to implement __builtin_unreachable
. As the documentation says, __assume(0)
must not be in a reachable branch of code, which means, that branch must be unreachable.