Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-05-01 20:26:40 +0200
committerMartin Hořeňovský2020-05-01 20:26:40 +0200
commitbbbc7a0d7fdc301d5f9f917426d62827927ca916 (patch)
tree2827db533a50da7fe39ccde3ec8c15b988f590f0 /src/catch2
parent89fab653824c4904867bc2e5e5ead7d3bbdeea37 (diff)
downloadcatch3-bbbc7a0d7fdc301d5f9f917426d62827927ca916.tar.gz
Fix CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTION interaction with feature macro
Diffstat (limited to 'src/catch2')
-rw-r--r--src/catch2/internal/catch_compiler_capabilities.hpp12
-rw-r--r--src/catch2/internal/catch_uncaught_exceptions.cpp2
2 files changed, 1 insertions, 13 deletions
diff --git a/src/catch2/internal/catch_compiler_capabilities.hpp b/src/catch2/internal/catch_compiler_capabilities.hpp
index 3990df7c..7e47d223 100644
--- a/src/catch2/internal/catch_compiler_capabilities.hpp
+++ b/src/catch2/internal/catch_compiler_capabilities.hpp
@@ -39,10 +39,6 @@
#endif
-#if defined(__cpp_lib_uncaught_exceptions)
-# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
-#endif
-
// We have to avoid both ICC and Clang, because they try to mask themselves
// as gcc, and we want only GCC in this block
#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC)
@@ -161,10 +157,6 @@
# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) )
# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) )
-# if _MSC_VER >= 1900 // Visual Studio 2015 or newer
-# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
-# endif
-
// Universal Windows platform does not support SEH
// Or console colours (or console at all...)
# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
@@ -292,10 +284,6 @@
# define CATCH_CONFIG_CPP17_OPTIONAL
#endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
-# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
-#endif
-
#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW)
# define CATCH_CONFIG_CPP17_STRING_VIEW
#endif
diff --git a/src/catch2/internal/catch_uncaught_exceptions.cpp b/src/catch2/internal/catch_uncaught_exceptions.cpp
index 3c699fb0..1aa863ad 100644
--- a/src/catch2/internal/catch_uncaught_exceptions.cpp
+++ b/src/catch2/internal/catch_uncaught_exceptions.cpp
@@ -12,7 +12,7 @@
namespace Catch {
bool uncaught_exceptions() {
-#if defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
+#if defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) || (defined(__cpp_lib_uncaught_exceptions) && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS))
return std::uncaught_exceptions() > 0;
#else
return std::uncaught_exception();