File tree 3 files changed +8
-3
lines changed
3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -61,7 +61,8 @@ void UseUsingCheck::check(const MatchFinder::MatchResult &Result) {
61
61
// before the typedef will be the nested one (PR#50990). Therefore, we also
62
62
// keep track of the parent declaration, so that we can look up the last
63
63
// TagDecl that is a sibling of the typedef in the AST.
64
- LastTagDeclRanges[ParentDecl] = MatchedTagDecl->getSourceRange ();
64
+ if (MatchedTagDecl->isThisDeclarationADefinition ())
65
+ LastTagDeclRanges[ParentDecl] = MatchedTagDecl->getSourceRange ();
65
66
return ;
66
67
}
67
68
Original file line number Diff line number Diff line change @@ -279,8 +279,8 @@ Changes in existing checks
279
279
fixes for reordering arguments.
280
280
281
281
- Improved :doc: `modernize-use-using
282
- <clang-tidy/checks/modernize/use-using>` check to fix function pointer
283
- ``typedef `` correctly.
282
+ <clang-tidy/checks/modernize/use-using>` check to fix function pointer and
283
+ forward declared ``typedef `` correctly.
284
284
285
285
- Improved :doc: `performance-faster-string-find
286
286
<clang-tidy/checks/performance/faster-string-find>` check to properly escape
Original file line number Diff line number Diff line change @@ -321,3 +321,7 @@ typedef bool (*ISSUE_65055_2)(int);
321
321
// CHECK-MESSAGES: :[[@LINE-2]]:1: warning: use 'using' instead of 'typedef'
322
322
// CHECK-FIXES: {{^}}using ISSUE_65055_1 = void (*)(int);{{$}}
323
323
// CHECK-FIXES: {{^}}using ISSUE_65055_2 = bool (*)(int);{{$}}
324
+
325
+ typedef class ISSUE_67529_1 *ISSUE_67529;
326
+ // CHECK-MESSAGES: :[[@LINE-1]]:1: warning: use 'using' instead of 'typedef'
327
+ // CHECK-FIXES: using ISSUE_67529 = class ISSUE_67529_1 *;
You can’t perform that action at this time.
0 commit comments