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

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRutayan Patro2022-09-26 12:07:50 -0400
committerGitHub2022-09-26 18:07:50 +0200
commit97d0b1e00ed198eb74351874aa8b42423b93c67a (patch)
treeedd58d94baf77d91c5e06089ce89ab52578488b3 /src
parentc0e582e65955f84312548bcee36b962a013f262f (diff)
downloadcatch3-97d0b1e00ed198eb74351874aa8b42423b93c67a.tar.gz
Suppress clang-tidy warnings for TEMPLATE_TEST_CASE (#2536)
* Suppress clang-tidy *-avoid-c-arrays for TEMPLATE_TEST_CASE * Made globalRegistrar `const` to avoid `cppcoreguidelines-avoid-non-const-global-variables` Fixes #2095
Diffstat (limited to 'src')
-rw-r--r--src/catch2/internal/catch_template_test_registry.hpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/catch2/internal/catch_template_test_registry.hpp b/src/catch2/internal/catch_template_test_registry.hpp
index bfac3bc8..dfc80726 100644
--- a/src/catch2/internal/catch_template_test_registry.hpp
+++ b/src/catch2/internal/catch_template_test_registry.hpp
@@ -84,12 +84,12 @@
struct TestName{\
TestName(){\
size_t index = 0; \
- constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
- using expander = size_t[];\
+ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)}; /* NOLINT(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,hicpp-avoid-c-arrays) */\
+ using expander = size_t[]; /* NOLINT(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays,hicpp-avoid-c-arrays) */\
(void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \
}\
};\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
+ static const int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
TestName<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>();\
return 0;\
}();\