Skip to content

Commit 7d0cfd2

Browse files
committed
Fix deprecation warning in ~ScopedMessage
1 parent 3fe4d39 commit 7d0cfd2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/internal/catch_message.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,18 @@ namespace Catch {
3737
: m_info( other.m_info )
3838
{}
3939

40+
#if defined(_MSC_VER)
41+
#pragma warning(push)
42+
#pragma warning(disable:4996) // std::uncaught_exception is deprecated in C++17
43+
#endif
4044
ScopedMessage::~ScopedMessage() {
4145
if ( !std::uncaught_exception() ){
4246
getResultCapture().popScopedMessage(m_info);
4347
}
4448
}
49+
#if defined(_MSC_VER)
50+
#pragma warning(pop)
51+
#endif
4552

4653

4754
} // end namespace Catch

0 commit comments

Comments
 (0)