class A { public: ~A() { if (std::uncaught_exception()) { // Called because of an exception } else { // No exception } } };