diff --git a/clang/lib/Frontend/TextDiagnostic.cpp b/clang/lib/Frontend/TextDiagnostic.cpp --- a/clang/lib/Frontend/TextDiagnostic.cpp +++ b/clang/lib/Frontend/TextDiagnostic.cpp @@ -896,10 +896,11 @@ } void TextDiagnostic::emitIncludeLocation(FullSourceLoc Loc, PresumedLoc PLoc) { - if (DiagOpts->ShowLocation && PLoc.isValid()) - OS << "In file included from " << PLoc.getFilename() << ':' - << PLoc.getLine() << ":\n"; - else + if (DiagOpts->ShowLocation && PLoc.isValid()) { + OS << "In file included from "; + emitFilename(PLoc.getFilename(), Loc.getManager()); + OS << ':' << PLoc.getLine() << ":\n"; + } else OS << "In included file:\n"; }