Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Fix std::uncaught_exception deprecation warning in ~ScopedMessage

Closes #1124
Commit
c4d1aa90337300a8c7646b3f28b0a6783eec5a8f
Author
Martin Hořeňovský ·
Parents
495d2458e078

Files · Download .tar.gz

Changes

 include/internal/catch_message.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/internal/catch_message.cpp b/include/internal/catch_message.cpp
index a66c5271..513c1776 100644
--- a/include/internal/catch_message.cpp
+++ b/include/internal/catch_message.cpp
@@ -49,11 +49,18 @@ namespace Catch {
         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() {
         if ( !std::uncaught_exception() ){
             getResultCapture().popScopedMessage(m_info);
         }
     }
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
 
 
 } // end namespace Catch