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 {
139139
140140 auto CurrentIt = Files.rbegin ();
141141 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 ;
144146 } while (CurrentIt++ != It);
145147 }
146148
Original file line number Diff line number Diff line change @@ -317,6 +317,10 @@ Changes in existing checks
317317 Additionally, the option `UseHeaderFileExtensions ` is removed, so that the
318318 check uses the `HeaderFileExtensions ` option unconditionally.
319319
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+
320324- Improved :doc: `misc-unused-using-decls
321325 <clang-tidy/checks/misc/unused-using-decls>` check by replacing the local
322326 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