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

clang-tidy warning due to readability-identifier-naming #111

Open
avitase opened this issue Mar 26, 2024 · 2 comments
Open

clang-tidy warning due to readability-identifier-naming #111

avitase opened this issue Mar 26, 2024 · 2 comments

Comments

@avitase
Copy link

avitase commented Mar 26, 2024

I have created a new project called foo of type "static/shared". During building the project for the first time an error is thrown by clang-tidy due to "invalid case style for type template parameter", although there are no template parameters in the generated example!?

$ cmake --preset=dev && cmake --build --preset=dev
[ 16%] Building CXX object CMakeFiles/foo_foo.dir/source/foo.cpp.o
warning: invalid case style for type template parameter 'expr-type' [readability-identifier-naming]
[ 33%] Linking CXX static library libfoo.a
[ 33%] Built target foo_foo
[ 50%] Building CXX object example/CMakeFiles/empty_example.dir/empty_example.cpp.o
[ 66%] Building CXX object test/CMakeFiles/foo_test.dir/source/foo_test.cpp.o
[ 83%] Linking CXX executable empty_example
[ 83%] Built target empty_example
warning: invalid case style for type template parameter 'expr-type' [readability-identifier-naming]
[100%] Linking CXX executable foo_test
[100%] Built target foo_test

Changing the values of readability-identifier-naming.TemplateParameterCase and readability-identifier-naming.TypeTemplateParameterCase to aNy_CasE fixes this issue but obviously this shouldn't be the solution... Any idea what actually triggers this warning?

@friendlyanon
Copy link
Owner

Where do these warnings come from? Your output doesn't associate them to a particular line. Are they coming from 3rd party headers? Are you using clang-tidy-14 or a newer version?

@avitase
Copy link
Author

avitase commented Mar 27, 2024

I don't know where this error comes from. I haven't changed any of the files from the generated template and the error log shown above is all that I have. I am also confused to not see any line numbers and my best guess is either source/foo.cpp, include/foo/foo.hpp, or the generated foo/foo_export.hpp. However, none of them are using templates. I am running

$ clang-tidy --version
Ubuntu LLVM version 14.0.0
  
  Optimized build.
  Default target: x86_64-pc-linux-gnu
  Host CPU: tigerlake

on an Ubuntu 22.04.4.

Btw, setting WarningAsErrors to '*' in the .clang-tidy configuration file let the build fail, therefore I would say that this is a genuine "warning" from clang-tidy.

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

No branches or pull requests

2 participants