File tree Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -123,6 +123,9 @@ static const NamedDecl *getFailureForNamedDecl(const NamedDecl *ND) {
123
123
if (const auto *Method = dyn_cast<CXXMethodDecl>(ND)) {
124
124
if (const CXXMethodDecl *Overridden = getOverrideMethod (Method))
125
125
Canonical = cast<NamedDecl>(Overridden->getCanonicalDecl ());
126
+ else if (const FunctionTemplateDecl *Primary = Method->getPrimaryTemplate ())
127
+ Canonical =
128
+ cast<NamedDecl>(Primary->getTemplatedDecl ()->getCanonicalDecl ());
126
129
127
130
if (Canonical != ND)
128
131
return Canonical;
Original file line number Diff line number Diff line change @@ -343,7 +343,8 @@ Changes in existing checks
343
343
<clang-tidy/checks/readability/identifier-naming>` check in `GetConfigPerFile `
344
344
mode by resolving symbolic links to header files. Fixed handling of Hungarian
345
345
Prefix when configured to `LowerCase `. Added support for renaming designated
346
- initializers. Added support for renaming macro arguments.
346
+ initializers. Added support for renaming macro arguments. Fixed renaming
347
+ conflicts arising from out-of-line member function template definitions.
347
348
348
349
- Improved :doc: `readability-implicit-bool-conversion
349
350
<clang-tidy/checks/readability/implicit-bool-conversion>` check to provide
Original file line number Diff line number Diff line change
1
+ // RUN: %check_clang_tidy %s readability-identifier-naming %t -std=c++20 \
2
+ // RUN: --config='{CheckOptions: { \
3
+ // RUN: readability-identifier-naming.MethodCase: CamelCase, \
4
+ // RUN: }}'
5
+
6
+ namespace SomeNamespace {
7
+ namespace Inner {
8
+
9
+ class SomeClass {
10
+ public:
11
+ template <typename T>
12
+ int someMethod ();
13
+ // CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for method 'someMethod' [readability-identifier-naming]
14
+ // CHECK-FIXES: {{^}} int SomeMethod();
15
+ };
16
+ template <typename T>
17
+ int SomeClass::someMethod () {
18
+ // CHECK-FIXES: {{^}}int SomeClass::SomeMethod() {
19
+ return 5 ;
20
+ }
21
+
22
+ } // namespace Inner
23
+
24
+ void someFunc () {
25
+ Inner::SomeClass S;
26
+ S.someMethod <int >();
27
+ // CHECK-FIXES: {{^}} S.SomeMethod<int>();
28
+ }
29
+
30
+ } // namespace SomeNamespace
You can’t perform that action at this time.
0 commit comments