From 7bcfdf8e9441ddf38667f2a10f671d122147f0fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Thu, 15 Jun 2017 11:43:31 +0200 Subject: [PATCH] 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 --- 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 {