File tree Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Expand file tree Collapse file tree 3 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -139,8 +139,10 @@ class CyclicDependencyCallbacks : public PPCallbacks {
139
139
140
140
auto CurrentIt = Files.rbegin ();
141
141
do {
142
- Check.diag (CurrentIt->Loc , " '%0' included from here" , DiagnosticIDs::Note)
143
- << CurrentIt->Name ;
142
+ if (CurrentIt->Loc .isValid ())
143
+ Check.diag (CurrentIt->Loc , " '%0' included from here" ,
144
+ DiagnosticIDs::Note)
145
+ << CurrentIt->Name ;
144
146
} while (CurrentIt++ != It);
145
147
}
146
148
Original file line number Diff line number Diff line change @@ -317,6 +317,10 @@ Changes in existing checks
317
317
Additionally, the option `UseHeaderFileExtensions ` is removed, so that the
318
318
check uses the `HeaderFileExtensions ` option unconditionally.
319
319
320
+ - Improved :doc: `misc-header-include-cycle
321
+ <clang-tidy/checks/misc/header-include-cycle>` check by avoiding crash for self
322
+ include cycles.
323
+
320
324
- Improved :doc: `misc-unused-using-decls
321
325
<clang-tidy/checks/misc/unused-using-decls>` check by replacing the local
322
326
option `HeaderFileExtensions ` by the global option of the same name.
Original file line number Diff line number Diff line change
1
+ // RUN: not clang-tidy %s -checks='-*,misc-header-include-cycle'
2
+
3
+ #include " header-include-cycle.self.cpp"
You can’t perform that action at this time.
0 commit comments