Index: clang/lib/Frontend/CompilerInvocation.cpp =================================================================== --- clang/lib/Frontend/CompilerInvocation.cpp +++ clang/lib/Frontend/CompilerInvocation.cpp @@ -1566,7 +1566,14 @@ frontend::IncludeDirGroup Group = frontend::System; if (A->getOption().matches(OPT_internal_externc_isystem)) Group = frontend::ExternCSystem; - Opts.AddPath(A->getValue(), Group, false, true); + + SmallString<128> P(D.ResourceDir); + llvm::sys::path::append(P, "include"); + + if (StringRef(A->getValue()) == P) + Opts.AddPath(A->getValue(), Group, false, true); + else + Opts.AddPath(A->getValue(), Group, false, false); } // Add the path prefixes which are implicitly treated as being system headers. @@ -2765,8 +2772,6 @@ Diags.Report(diag::err_invalid_vfs_overlay) << File; return IntrusiveRefCntPtr(); } - Overlay->pushOverlay(FS); - } return Overlay; } } // end namespace clang