This compiles under Visual Studio but in g++ it causes an error "error: no matching function for call to `std::exception::exception(const char[5])"Code:#include <iostream> int main() { try { throw std::exception("test"); } catch(std::exception& e) { std::cerr << e.what() << '\n'; } catch(...) { std::cerr << "...\n"; } }
So why does it work under one compiler but not the other?