aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-outofline.cpp
blob: 2945047dee4caa4720cf027e99bc640c20a49239 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// RUN: %check_clang_tidy %s readability-identifier-naming %t -std=c++20 \
// RUN:   --config='{CheckOptions: { \
// RUN:     readability-identifier-naming.MethodCase: CamelCase, \
// RUN:  }}'

namespace SomeNamespace {
namespace Inner {

class SomeClass {
public:
    template <typename T>
    int someMethod();
// CHECK-MESSAGES: :[[@LINE-1]]:9: warning: invalid case style for method 'someMethod' [readability-identifier-naming]
// CHECK-FIXES: int SomeMethod();
};
template <typename T>
int SomeClass::someMethod() {
// CHECK-FIXES: int SomeClass::SomeMethod() {
    return 5;
}

} // namespace Inner

void someFunc() {
    Inner::SomeClass S;
    S.someMethod<int>();
// CHECK-FIXES: S.SomeMethod<int>();
}

} // namespace SomeNamespace