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 deprecation warning in ~ScopedMessage

Commit
7d0cfd27ce197433e9fe6768e5f750d034415fce
Author
Martin Hořeňovský ·
Parents
3fe4d394a585

Files · Download .tar.gz

Changes

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

diff --git a/include/internal/catch_message.hpp b/include/internal/catch_message.hpp
index 11d07466..3b9297a4 100644
--- a/include/internal/catch_message.hpp
+++ b/include/internal/catch_message.hpp
@@ -37,11 +37,18 @@ namespace Catch {
     : m_info( other.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