Skip to content

Instantly share code, notes, and snippets.

@njlr
Created May 16, 2017 13:46
Show Gist options
  • Save njlr/fa7a94cfde6d8543624f5340007890fa to your computer and use it in GitHub Desktop.
Save njlr/fa7a94cfde6d8543624f5340007890fa to your computer and use it in GitHub Desktop.
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