[cfe-dev] [clang-tidy] readability-identifier-naming reports bogus? warning in c++20 mode

Fabio Fracassi via cfe-dev cfe-dev at lists.llvm.org
Mon Jul 19 09:51:24 PDT 2021


Hello,

I just discovered the following issue with readability-identifier-naming:

I have this reduced code in test.cpp:

```
#include <string_view>
int main() {}
```

and I run the readability-identifier-naming check with this command line:

clang-tidy -header-filter=".*" --config="{ Checks:
'-*,readability-identifier-naming', CheckOptions: [{ key:
readability-identifier-naming.TemplateParameterCase, value: CamelCase
}]}" test.cpp -- -std=c++20 -stdlib=libc++

I get a warning (without a location):

warning: invalid case style for template parameter 'expr-type'
[readability-identifier-naming]

when I change the standard version to c++17 (-std=c++17) the warning
disappears. The warning also disappears if I do not include any headers.
It is there when I include either of <string>, <string_view> or
<iostream>, but disappears with <cstdio> (I did not test further).

The warning seems bogus, it does not have a location, and if I am not
mistaken 'expr-type' can not be a template parameter name.

Is this known? If not, where do I report the issue?

Best regards

Fabio






More information about the cfe-dev mailing list