diff --git a/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp b/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp --- a/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp +++ b/clang/lib/Tooling/InterpolatingCompilationDatabase.cpp @@ -329,7 +329,7 @@ StringRef Path = Strings.save(StringRef(OriginalPaths[I]).lower()); Paths.emplace_back(Path, I); - Types.push_back(foldType(guessType(Path))); + Types.push_back(foldType(guessType(StringRef(OriginalPaths[I])))); Stems.emplace_back(sys::path::stem(Path), I); auto Dir = ++sys::path::rbegin(Path), DirEnd = sys::path::rend(Path); for (int J = 0; J < DirectorySegmentsIndexed && Dir != DirEnd; ++J, ++Dir)