Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEMPLATE_TEST_CASE breaks clang-tidy check modernize-avoid-c-arrays #2095

Closed
cjdb opened this issue Nov 5, 2020 · 4 comments · Fixed by #2536
Closed

TEMPLATE_TEST_CASE breaks clang-tidy check modernize-avoid-c-arrays #2095

cjdb opened this issue Nov 5, 2020 · 4 comments · Fixed by #2536

Comments

@cjdb
Copy link
Contributor

cjdb commented Nov 5, 2020

Describe the bug
TEMPLATE_TEST_CASE uses a C array in its definition, which breaks the clang-tidy check modernize-avoid-c-arrays.

Expected behavior
clang-tidy shouldn't report anything.

Reproduction steps

TEMPLATE_TEST_CASE("", "", int) {} // this should be enough

Platform information:

  • OS: WSL2 Ubuntu 20.04
  • Compiler+version: GCC 10.2, clang-tidy 12
  • Catch version: Head
@horenmar
Copy link
Member

horenmar commented Nov 7, 2020

ugh, that's just clang-tidy being stupid and not understanding the "initialize discarded array to do something over an arg pack" idiom.

I'll suppress it when I get around to it, alternatively PRs are welcome. 😉

@cjdb
Copy link
Contributor Author

cjdb commented Nov 8, 2020

Do you want it to be changed to std::array or // NOLINT(modernize-avoid-c-arrays)?

@horenmar
Copy link
Member

horenmar commented Nov 8, 2020

NOLINT, there is no reason to drag in an extra header

@rutayan
Copy link
Contributor

rutayan commented Sep 23, 2022

I have taken a stab at it.
This is my first time contributing here. I am not sure how to add reviewers.

horenmar pushed a commit that referenced this issue Sep 26, 2022
* Suppress clang-tidy *-avoid-c-arrays for TEMPLATE_TEST_CASE
* Made globalRegistrar `const` to avoid `cppcoreguidelines-avoid-non-const-global-variables`

Fixes #2095
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants