[clang] Don't include C++ Standard Library headers when -nostdinc is used
authorLouis Dionne <ldionne.2@gmail.com>
Tue, 15 Nov 2022 21:41:55 +0000 (16:41 -0500)
committerLouis Dionne <ldionne.2@gmail.com>
Wed, 16 Nov 2022 20:25:32 +0000 (15:25 -0500)
commit9621b1776a1b3d16735b3c5da31585ad64a018df
tree52f0974b5f0e52bd3beeb19f95f124b7da34e64e
parentb5d74f0e837f1cfa6761bd01df2e372e0481d8a9
[clang] Don't include C++ Standard Library headers when -nostdinc is used

This is a follow-up to 53c98d85a, which made the same change but only
for GNU. It seems that we should try to provide a consistent behavior
across all targets.

This fixes an issue where clang/test/Driver/nostdincxx.cpp would start
failing on non-GNU targets because that test was too loose in its checks.
It would only check that 'file not found' was part of the error message,
but didn't ensure that the file we had not found was <vector>.

Differential Revision: https://reviews.llvm.org/D138062
clang/lib/Driver/ToolChains/Darwin.cpp
clang/lib/Driver/ToolChains/Fuchsia.cpp
clang/lib/Driver/ToolChains/MinGW.cpp
clang/lib/Driver/ToolChains/WebAssembly.cpp
clang/test/Driver/darwin-header-search-libcxx.cpp
clang/test/Driver/nostdincxx.cpp