diff options
| author | Christian Tacke | 2023-08-20 22:11:38 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2023-09-25 10:56:45 +0200 |
| commit | 0fb817e41ff24715f3436ede5a18de468c272902 (patch) | |
| tree | 55be34c2ac6baf0c7b0c0ae8e46415e318d3c44a | |
| parent | f161110be4d91d15adfd8967d5f9429fc0020615 (diff) | |
| download | catch3-0fb817e41ff24715f3436ede5a18de468c272902.tar.gz | |
fix some bugprone-macro-parentheses warnings
When using the public headers of catch2 in another project
that uses clang-tidy with some checks enabled, then some
warnings in catch2's headers are also reported.
This fixes a bunch of bugprone-macro-parentheses warnings.
See: https://clang.llvm.org/extra/clang-tidy/checks/bugprone/macro-parentheses.html
| -rw-r--r-- | src/catch2/internal/catch_test_macro_impl.hpp | 2 | ||||
| -rw-r--r-- | src/catch2/internal/catch_test_registry.hpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/catch2/internal/catch_test_macro_impl.hpp b/src/catch2/internal/catch_test_macro_impl.hpp index 39366023..59c851e8 100644 --- a/src/catch2/internal/catch_test_macro_impl.hpp +++ b/src/catch2/internal/catch_test_macro_impl.hpp @@ -34,7 +34,7 @@ #else // CATCH_CONFIG_FAST_COMPILE #define INTERNAL_CATCH_TRY try -#define INTERNAL_CATCH_CATCH( handler ) catch(...) { handler.handleUnexpectedInflightException(); } +#define INTERNAL_CATCH_CATCH( handler ) catch(...) { (handler).handleUnexpectedInflightException(); } #endif diff --git a/src/catch2/internal/catch_test_registry.hpp b/src/catch2/internal/catch_test_registry.hpp index d248d3cf..7766fe11 100644 --- a/src/catch2/internal/catch_test_registry.hpp +++ b/src/catch2/internal/catch_test_registry.hpp @@ -113,7 +113,7 @@ static int catchInternalSectionHint = 0; CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \ static const Catch::Detail::DummyUse INTERNAL_CATCH_UNIQUE_NAME( \ - dummyUser )( &fname ); \ + dummyUser )( &(fname) ); \ CATCH_INTERNAL_SUPPRESS_SHADOW_WARNINGS \ static void fname( [[maybe_unused]] int catchInternalSectionHint ) \ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION |