This is an archive of the discontinued LLVM Phabricator instance.

[clang] Don't include C++ Standard Library headers when -nostdinc is used
ClosedPublic

Authored by ldionne on Nov 15 2022, 2:04 PM.

Details

Summary

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>.

Diff Detail

Event Timeline

ldionne created this revision.Nov 15 2022, 2:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2022, 2:04 PM
ldionne requested review of this revision.Nov 15 2022, 2:04 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2022, 2:04 PM
ldionne added a reviewer: Restricted Project.Nov 15 2022, 2:06 PM

I'm not sure who else to add on this review. Since changing the behavior of user-facing flags can be breaking, I'm adding the vendors. Feel free to suggest more.

Note that this was discovered when landing D136683.

MaskRay accepted this revision as: MaskRay.Nov 15 2022, 3:14 PM
This revision is now accepted and ready to land.Nov 15 2022, 3:14 PM
mgorny accepted this revision as: mgorny.Nov 15 2022, 11:04 PM
mgorny added a subscriber: mgorny.

I'd say this is fine to land as 16.x. I'll be doing another snapshot for Gentoo next weekend, so if it lands by then, we're going to do some crash testing.

phosek accepted this revision.Nov 15 2022, 11:06 PM

LGTM

Thanks! I'll land this and watch for any fallout.

This revision was landed with ongoing or failed builds.Nov 16 2022, 12:26 PM
This revision was automatically updated to reflect the committed changes.