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

Disable deprecation warning of std::uncaught_exception

We might prefer to use `std::uncaught_exceptions` in the future, but I
would prefer not to bring in more configuration into Catch Classic

Closes #927
Commit
b90d0b72679a0e69a059eb87c531a7e30c95cd6b
Author
Martin Hořeňovský ·
Parents
efba988ccc3f

Files · Download .tar.gz

Changes

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

diff --git a/include/internal/catch_section.hpp b/include/internal/catch_section.hpp
index a5d1b6d5..aab721f6 100644
--- a/include/internal/catch_section.hpp
+++ b/include/internal/catch_section.hpp
@@ -30,6 +30,10 @@ namespace Catch {
         m_timer.start();
     }
 
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4996) // std::uncaught_exception is deprecated in C++17
+#endif
     Section::~Section() {
         if( m_sectionIncluded ) {
             SectionEndInfo endInfo( m_info, m_assertions, m_timer.getElapsedSeconds() );
@@ -39,6 +43,9 @@ namespace Catch {
                 getResultCapture().sectionEnded( endInfo );
         }
     }
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
 
     // This indicates whether the section should be executed or not
     Section::operator bool() const {