From ed4acded380ac5408acf9fa518984cbe1bbe25bd Mon Sep 17 00:00:00 2001 From: Vitalii Trubchaninov Date: Mon, 31 Jul 2023 14:26:03 -0400 Subject: [PATCH] Don't define tryTranslators function if exception are disabled "-Wunused-function -Wall" produces if this function is defined when exceptions are disabled --- src/catch2/internal/catch_exception_translator_registry.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/catch2/internal/catch_exception_translator_registry.cpp b/src/catch2/internal/catch_exception_translator_registry.cpp index f3d47c0c..103fc9ae 100644 --- a/src/catch2/internal/catch_exception_translator_registry.cpp +++ b/src/catch2/internal/catch_exception_translator_registry.cpp @@ -15,6 +15,7 @@ namespace Catch { +#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) namespace { static std::string tryTranslators( std::vector< @@ -28,6 +29,7 @@ namespace Catch { } } +#endif //!defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) ExceptionTranslatorRegistry::~ExceptionTranslatorRegistry() { }