Created
May 16, 2017 13:46
-
-
Save njlr/fa7a94cfde6d8543624f5340007890fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int foo() throw(int) { | |
throw "bar"; | |
return 1; | |
} | |
int bar() noexcept { | |
throw 42; | |
return 1; | |
} | |
// These compile fine, but on execution std::terminate is called and the program exits | |
int main() { | |
try { | |
int x = foo(); | |
} catch(...) { | |
} | |
} | |
int main() { | |
try { | |
int x = bar(); | |
} catch(...) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment