diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b52122fc..5c724a46 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -116,6 +116,7 @@ set(INTERNAL_HEADERS ${SOURCES_DIR}/internal/catch_platform.hpp ${SOURCES_DIR}/internal/catch_polyfills.hpp ${SOURCES_DIR}/internal/catch_preprocessor.hpp + ${SOURCES_DIR}/internal/catch_preprocessor_remove_parens.hpp ${SOURCES_DIR}/internal/catch_random_number_generator.hpp ${SOURCES_DIR}/internal/catch_random_seed_generation.hpp ${SOURCES_DIR}/reporters/catch_reporter_registrars.hpp diff --git a/src/catch2/benchmark/detail/catch_stats.cpp b/src/catch2/benchmark/detail/catch_stats.cpp index deba9a0e..8f13f59a 100644 --- a/src/catch2/benchmark/detail/catch_stats.cpp +++ b/src/catch2/benchmark/detail/catch_stats.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include diff --git a/src/catch2/catch_all.hpp b/src/catch2/catch_all.hpp index 77dd00c3..79f38f3b 100644 --- a/src/catch2/catch_all.hpp +++ b/src/catch2/catch_all.hpp @@ -80,6 +80,7 @@ #include #include #include +#include #include #include #include diff --git a/src/catch2/catch_approx.cpp b/src/catch2/catch_approx.cpp index 50cb75c3..21652111 100644 --- a/src/catch2/catch_approx.cpp +++ b/src/catch2/catch_approx.cpp @@ -7,6 +7,7 @@ // SPDX-License-Identifier: BSL-1.0 #include #include +#include #include #include diff --git a/src/catch2/catch_config.cpp b/src/catch2/catch_config.cpp index b96cf46a..1f631f45 100644 --- a/src/catch2/catch_config.cpp +++ b/src/catch2/catch_config.cpp @@ -16,8 +16,6 @@ #include #include -#include - namespace Catch { bool operator==( ProcessedReporterSpec const& lhs, diff --git a/src/catch2/catch_config.hpp b/src/catch2/catch_config.hpp index 2b57bbb5..8823accd 100644 --- a/src/catch2/catch_config.hpp +++ b/src/catch2/catch_config.hpp @@ -9,16 +9,17 @@ #define CATCH_CONFIG_HPP_INCLUDED #include -#include #include #include #include +#include #include #include -#include -#include +#include +#include #include +#include namespace Catch { diff --git a/src/catch2/catch_test_case_info.cpp b/src/catch2/catch_test_case_info.cpp index 83cfcc8e..6d89dc72 100644 --- a/src/catch2/catch_test_case_info.cpp +++ b/src/catch2/catch_test_case_info.cpp @@ -7,8 +7,6 @@ // SPDX-License-Identifier: BSL-1.0 #include #include -#include -#include #include #include diff --git a/src/catch2/catch_test_macros.hpp b/src/catch2/catch_test_macros.hpp index dde1c9cd..e92a45f0 100644 --- a/src/catch2/catch_test_macros.hpp +++ b/src/catch2/catch_test_macros.hpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/src/catch2/catch_totals.hpp b/src/catch2/catch_totals.hpp index 7ab6a1b6..6bc444fc 100644 --- a/src/catch2/catch_totals.hpp +++ b/src/catch2/catch_totals.hpp @@ -8,7 +8,6 @@ #ifndef CATCH_TOTALS_HPP_INCLUDED #define CATCH_TOTALS_HPP_INCLUDED -#include #include namespace Catch { diff --git a/src/catch2/generators/catch_generators.hpp b/src/catch2/generators/catch_generators.hpp index 948d6f0f..acfdb7dc 100644 --- a/src/catch2/generators/catch_generators.hpp +++ b/src/catch2/generators/catch_generators.hpp @@ -12,6 +12,8 @@ #include #include #include +#include +#include #include #include diff --git a/src/catch2/internal/catch_assertion_handler.hpp b/src/catch2/internal/catch_assertion_handler.hpp index 4d397766..5faa5e4b 100644 --- a/src/catch2/internal/catch_assertion_handler.hpp +++ b/src/catch2/internal/catch_assertion_handler.hpp @@ -13,11 +13,11 @@ #include #include +#include + namespace Catch { - struct AssertionResultData; class IResultCapture; - class RunContext; struct AssertionReaction { bool shouldDebugBreak = false; diff --git a/src/catch2/internal/catch_case_insensitive_comparisons.hpp b/src/catch2/internal/catch_case_insensitive_comparisons.hpp index 5742e6b7..c182e13e 100644 --- a/src/catch2/internal/catch_case_insensitive_comparisons.hpp +++ b/src/catch2/internal/catch_case_insensitive_comparisons.hpp @@ -10,8 +10,6 @@ #include -#include - namespace Catch { namespace Detail { //! Provides case-insensitive `op<` semantics when called diff --git a/src/catch2/internal/catch_clara.cpp b/src/catch2/internal/catch_clara.cpp index df844838..a4701a81 100644 --- a/src/catch2/internal/catch_clara.cpp +++ b/src/catch2/internal/catch_clara.cpp @@ -5,13 +5,16 @@ // https://www.boost.org/LICENSE_1_0.txt) // SPDX-License-Identifier: BSL-1.0 -#include + #include #include #include #include #include +#include +#include + namespace { bool isOptPrefix( char c ) { return c == '-' diff --git a/src/catch2/internal/catch_clara.hpp b/src/catch2/internal/catch_clara.hpp index add00c0d..6e3138ae 100644 --- a/src/catch2/internal/catch_clara.hpp +++ b/src/catch2/internal/catch_clara.hpp @@ -35,7 +35,6 @@ #include #include -#include #include #include #include diff --git a/src/catch2/internal/catch_commandline.cpp b/src/catch2/internal/catch_commandline.cpp index fb2275d1..81787aa9 100644 --- a/src/catch2/internal/catch_commandline.cpp +++ b/src/catch2/internal/catch_commandline.cpp @@ -13,11 +13,9 @@ #include #include #include -#include #include #include -#include #include #include diff --git a/src/catch2/internal/catch_console_colour.cpp b/src/catch2/internal/catch_console_colour.cpp index ae22d67b..e2a175f1 100644 --- a/src/catch2/internal/catch_console_colour.cpp +++ b/src/catch2/internal/catch_console_colour.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -23,7 +24,9 @@ #include #include +#include #include +#include namespace Catch { diff --git a/src/catch2/internal/catch_console_colour.hpp b/src/catch2/internal/catch_console_colour.hpp index 661078af..aa3d83a2 100644 --- a/src/catch2/internal/catch_console_colour.hpp +++ b/src/catch2/internal/catch_console_colour.hpp @@ -16,7 +16,6 @@ namespace Catch { enum class ColourMode : std::uint8_t; - class IConfig; class IStream; struct Colour { diff --git a/src/catch2/internal/catch_debug_console.cpp b/src/catch2/internal/catch_debug_console.cpp index 5942524e..d13cc0bb 100644 --- a/src/catch2/internal/catch_debug_console.cpp +++ b/src/catch2/internal/catch_debug_console.cpp @@ -11,6 +11,8 @@ #include #include +#include + #if defined(CATCH_CONFIG_ANDROID_LOGWRITE) #include diff --git a/src/catch2/internal/catch_preprocessor.hpp b/src/catch2/internal/catch_preprocessor.hpp index 3aac18df..f3156316 100644 --- a/src/catch2/internal/catch_preprocessor.hpp +++ b/src/catch2/internal/catch_preprocessor.hpp @@ -9,6 +9,7 @@ #define CATCH_PREPROCESSOR_HPP_INCLUDED #include +#include #if defined(CATCH_COMPILER_GCC) // We need to silence "empty __VA_ARGS__ warning", and using just _Pragma does not work @@ -60,10 +61,6 @@ #define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0)) -#define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param) -#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__ -#define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__ -#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF #define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__) #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__ @@ -78,8 +75,6 @@ #define INTERNAL_CATCH_MAKE_NAMESPACE2(...) ns_##__VA_ARGS__ #define INTERNAL_CATCH_MAKE_NAMESPACE(name) INTERNAL_CATCH_MAKE_NAMESPACE2(name) -#define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__) - #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR #define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) decltype(get_wrapper()) #define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)) diff --git a/src/catch2/internal/catch_preprocessor_remove_parens.hpp b/src/catch2/internal/catch_preprocessor_remove_parens.hpp new file mode 100644 index 00000000..80337890 --- /dev/null +++ b/src/catch2/internal/catch_preprocessor_remove_parens.hpp @@ -0,0 +1,19 @@ + +// Copyright Catch2 Authors +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// https://www.boost.org/LICENSE_1_0.txt) + +// SPDX-License-Identifier: BSL-1.0 +#ifndef CATCH_PREPROCESSOR_REMOVE_PARENS_HPP_INCLUDED +#define CATCH_PREPROCESSOR_REMOVE_PARENS_HPP_INCLUDED + +#define INTERNAL_CATCH_EXPAND1( param ) INTERNAL_CATCH_EXPAND2( param ) +#define INTERNAL_CATCH_EXPAND2( ... ) INTERNAL_CATCH_NO##__VA_ARGS__ +#define INTERNAL_CATCH_DEF( ... ) INTERNAL_CATCH_DEF __VA_ARGS__ +#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF + +#define INTERNAL_CATCH_REMOVE_PARENS( ... ) \ + INTERNAL_CATCH_EXPAND1( INTERNAL_CATCH_DEF __VA_ARGS__ ) + +#endif // CATCH_PREPROCESSOR_REMOVE_PARENS_HPP_INCLUDED diff --git a/src/catch2/internal/catch_reporter_spec_parser.cpp b/src/catch2/internal/catch_reporter_spec_parser.cpp index 378a6f5a..28b2088a 100644 --- a/src/catch2/internal/catch_reporter_spec_parser.cpp +++ b/src/catch2/internal/catch_reporter_spec_parser.cpp @@ -12,7 +12,6 @@ #include #include -#include namespace Catch { diff --git a/src/catch2/internal/catch_tag_alias_registry.hpp b/src/catch2/internal/catch_tag_alias_registry.hpp index 9dd86c13..3dbe0528 100644 --- a/src/catch2/internal/catch_tag_alias_registry.hpp +++ b/src/catch2/internal/catch_tag_alias_registry.hpp @@ -15,6 +15,7 @@ #include namespace Catch { + struct SourceLineInfo; class TagAliasRegistry : public ITagAliasRegistry { public: diff --git a/src/catch2/internal/catch_test_registry.hpp b/src/catch2/internal/catch_test_registry.hpp index cd28dd66..60508465 100644 --- a/src/catch2/internal/catch_test_registry.hpp +++ b/src/catch2/internal/catch_test_registry.hpp @@ -15,6 +15,7 @@ #include #include #include +#include // GCC 5 and older do not properly handle disabling unused-variable warning // with a _Pragma. This means that we have to leak the suppression to the diff --git a/src/catch2/internal/catch_xmlwriter.hpp b/src/catch2/internal/catch_xmlwriter.hpp index 5be8277d..edeb64a2 100644 --- a/src/catch2/internal/catch_xmlwriter.hpp +++ b/src/catch2/internal/catch_xmlwriter.hpp @@ -11,6 +11,7 @@ #include #include +#include #include namespace Catch { diff --git a/src/catch2/reporters/catch_reporter_automake.hpp b/src/catch2/reporters/catch_reporter_automake.hpp index c544f337..cd85e6bf 100644 --- a/src/catch2/reporters/catch_reporter_automake.hpp +++ b/src/catch2/reporters/catch_reporter_automake.hpp @@ -10,6 +10,8 @@ #include +#include + namespace Catch { class AutomakeReporter final : public StreamingReporterBase { diff --git a/src/catch2/reporters/catch_reporter_cumulative_base.cpp b/src/catch2/reporters/catch_reporter_cumulative_base.cpp index b52ba7ef..957880d0 100644 --- a/src/catch2/reporters/catch_reporter_cumulative_base.cpp +++ b/src/catch2/reporters/catch_reporter_cumulative_base.cpp @@ -7,6 +7,8 @@ // SPDX-License-Identifier: BSL-1.0 #include +#include + #include #include diff --git a/src/catch2/reporters/catch_reporter_cumulative_base.hpp b/src/catch2/reporters/catch_reporter_cumulative_base.hpp index d43ca479..742eaac9 100644 --- a/src/catch2/reporters/catch_reporter_cumulative_base.hpp +++ b/src/catch2/reporters/catch_reporter_cumulative_base.hpp @@ -12,7 +12,6 @@ #include #include -#include #include #include diff --git a/src/catch2/reporters/catch_reporter_multi.cpp b/src/catch2/reporters/catch_reporter_multi.cpp index 86d39d6a..e8cf7bdf 100644 --- a/src/catch2/reporters/catch_reporter_multi.cpp +++ b/src/catch2/reporters/catch_reporter_multi.cpp @@ -11,8 +11,6 @@ #include #include -#include - namespace Catch { void MultiReporter::updatePreferences(IEventListener const& reporterish) { m_preferences.shouldRedirectStdOut |= diff --git a/src/catch2/reporters/catch_reporter_streaming_base.hpp b/src/catch2/reporters/catch_reporter_streaming_base.hpp index afa67d76..5088bd0b 100644 --- a/src/catch2/reporters/catch_reporter_streaming_base.hpp +++ b/src/catch2/reporters/catch_reporter_streaming_base.hpp @@ -10,8 +10,6 @@ #include -#include -#include #include namespace Catch { diff --git a/src/catch2/reporters/catch_reporter_tap.cpp b/src/catch2/reporters/catch_reporter_tap.cpp index 4cc91b7b..71249f87 100644 --- a/src/catch2/reporters/catch_reporter_tap.cpp +++ b/src/catch2/reporters/catch_reporter_tap.cpp @@ -11,6 +11,7 @@ #include #include +#include #include namespace Catch { diff --git a/src/catch2/reporters/catch_reporter_teamcity.cpp b/src/catch2/reporters/catch_reporter_teamcity.cpp index 8f16757a..142dffbb 100644 --- a/src/catch2/reporters/catch_reporter_teamcity.cpp +++ b/src/catch2/reporters/catch_reporter_teamcity.cpp @@ -14,6 +14,7 @@ #include #include +#include namespace Catch { diff --git a/tests/ExtraTests/X05-DeferredStaticChecks.cpp b/tests/ExtraTests/X05-DeferredStaticChecks.cpp index a09ed1cc..62ceb4a7 100644 --- a/tests/ExtraTests/X05-DeferredStaticChecks.cpp +++ b/tests/ExtraTests/X05-DeferredStaticChecks.cpp @@ -12,7 +12,6 @@ */ #include -#include TEST_CASE("Deferred static checks") { STATIC_CHECK(1 == 2);