Fix std::uncaught_exception deprecation warning in ~ScopedMessage

Closes #1124
This commit is contained in:
Martin Hořeňovský 2017-12-07 19:10:28 +01:00
parent 495d2458e0
commit c4d1aa9033

View File

@ -49,11 +49,18 @@ namespace Catch {
getResultCapture().pushScopedMessage( m_info ); getResultCapture().pushScopedMessage( m_info );
} }
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4996) // std::uncaught_exception is deprecated in C++17
#endif
ScopedMessage::~ScopedMessage() { ScopedMessage::~ScopedMessage() {
if ( !std::uncaught_exception() ){ if ( !std::uncaught_exception() ){
getResultCapture().popScopedMessage(m_info); getResultCapture().popScopedMessage(m_info);
} }
} }
#if defined(_MSC_VER)
#pragma warning(pop)
#endif
} // end namespace Catch } // end namespace Catch