File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -31,13 +31,12 @@ struct DenseMapInfo<clang::tidy::RenamerClangTidyCheck::NamingCheckId> {
31
31
using NamingCheckId = clang::tidy::RenamerClangTidyCheck::NamingCheckId;
32
32
33
33
static inline NamingCheckId getEmptyKey () {
34
- return {DenseMapInfo<clang::SourceLocation>::getEmptyKey (),
35
- " EMPTY" };
34
+ return {DenseMapInfo<clang::SourceLocation>::getEmptyKey (), " EMPTY" };
36
35
}
37
36
38
37
static inline NamingCheckId getTombstoneKey () {
39
38
return {DenseMapInfo<clang::SourceLocation>::getTombstoneKey (),
40
- " TOMBSTONE" };
39
+ " TOMBSTONE" };
41
40
}
42
41
43
42
static unsigned getHashValue (NamingCheckId Val) {
@@ -473,7 +472,7 @@ void RenamerClangTidyCheck::checkNamedDecl(const NamedDecl *Decl,
473
472
}
474
473
475
474
Failure.Info = std::move (Info);
476
- addUsage (Decl, Range);
475
+ addUsage (Decl, Range, &SourceMgr );
477
476
}
478
477
479
478
void RenamerClangTidyCheck::check (const MatchFinder::MatchResult &Result) {
Original file line number Diff line number Diff line change @@ -108,10 +108,12 @@ USER_NS::object g_s2;
108
108
// NO warnings or fixes expected as USER_NS and object are declared in a header file
109
109
110
110
SYSTEM_MACRO (var1);
111
- // NO warnings or fixes expected as var1 is from macro expansion
111
+ // CHECK-MESSAGES: :[[@LINE-1]]:14: warning: invalid case style for global variable 'var1' [readability-identifier-naming]
112
+ // CHECK-FIXES: {{^}}SYSTEM_MACRO(g_var1);
112
113
113
114
USER_MACRO (var2);
114
- // NO warnings or fixes expected as var2 is declared in a macro expansion
115
+ // CHECK-MESSAGES: :[[@LINE-1]]:12: warning: invalid case style for global variable 'var2' [readability-identifier-naming]
116
+ // CHECK-FIXES: {{^}}USER_MACRO(g_var2);
115
117
116
118
#define BLA int FOO_bar
117
119
BLA;
@@ -602,9 +604,11 @@ static void static_Function() {
602
604
// CHECK-FIXES: {{^}}#define MY_TEST_MACRO(X) X()
603
605
604
606
void MY_TEST_Macro (function) {}
605
- // CHECK-FIXES: {{^}}void MY_TEST_MACRO(function) {}
606
- }
607
- }
607
+ // CHECK-MESSAGES: :[[@LINE-1]]:20: warning: invalid case style for global function 'function' [readability-identifier-naming]
608
+ // CHECK-FIXES: {{^}}void MY_TEST_MACRO(Function) {}
609
+
610
+ } // namespace InlineNamespace
611
+ } // namespace FOO_NS
608
612
609
613
template <typename t_t > struct a {
610
614
// CHECK-MESSAGES: :[[@LINE-1]]:32: warning: invalid case style for struct 'a'
You can’t perform that action at this time.
0 commit comments