diff --git a/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp b/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp --- a/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp +++ b/clang-tools-extra/clang-tidy/utils/TransformerClangTidyCheck.cpp @@ -104,7 +104,8 @@ Diag << FixItHint::CreateReplacement(T.Range, T.Replacement); break; case transformer::EditKind::AddInclude: - Diag << Inserter.createMainFileIncludeInsertion(T.Replacement); + Diag << Inserter.createIncludeInsertion( + Result.SourceManager->getFileID(T.Range.getBegin()), T.Replacement); break; } }