Created attachment 18265 [details] reproduce the unexpected handler issue This happens in the release_40 branch. % clang++ unexpected.cpp -O3 % a.out terminate called after throwing an instance of 'int' Aborted % clang++ unexpected.cpp -O0 % a.out Unexpected handler was called. terminate called after throwing an instance of 'int' Aborted g++ and the x86 backend generate the latter output as well.
This is still reproducible on trunk. clang++ now emits a warning about the code, but the Unexpected handler is still optimized away.
Have a fix in this patch: https://reviews.llvm.org/D50987
It would be good to merge this into 7.0 as well if it can be approved/committed in time.
Marking this as a blocker for 7.0 so we don't forget to merge it to the release.
Merged to 7.0 in r340731.