Comment Comment by throwaway294566 Yes, but there is more to it: The compiler may assume that UB will never happen intentionally and optimize out the branch containing UB. parent throwaway294566 3 years ago