Skip to content

Instantly share code, notes, and snippets.

@justinsb
Created January 18, 2012 20:20
Show Gist options
  • Save justinsb/1635304 to your computer and use it in GitHub Desktop.
Save justinsb/1635304 to your computer and use it in GitHub Desktop.
mkdir test2
cd test2
cat > test.cc <<EOF
#include <memory>
#include <iostream>
#include <stdexcept>
using namespace std;
int main() {
try {
throw invalid_argument("Hello world");
} catch (exception& e) {
cerr << "Caught exception\n";
}
return 0;
}
EOF
g++ -m32 test.cc; ./a.out
# Caught exception
g++ -m64 test.cc; ./a.out
# terminate called after throwing an instance of 'std::invalid_argument'
# Abort (core dumped)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment