Previously, this would fail if the builtin headers had been "claimed" by a different module that wraps these builtin headers. libc++ does this, for example.
This change adds a test demonstrating this situation; the test fails without the fix.
Paths
| Differential D80781
[clang] Always allow including builtin headers in [no_undeclared_headers] modules. ClosedPublic Authored by mboehme on May 29 2020, 1:49 AM.
Details
Summary Previously, this would fail if the builtin headers had been "claimed" by a different module that wraps these builtin headers. libc++ does this, for example. This change adds a test demonstrating this situation; the test fails without the fix.
Diff Detail Event TimelineComment Actions Temporarily retracting from review as I've realized there's another case I need to take care of. Comment Actions When testing with the real libc++ and glibc, I realized that I was still getting a cyclic dependency between the two modules because the builtin stddef.h that glibc was including was still being ascribed to libc++. This modified version fixes this and also updates the test to more closely reflect the real libc++ and glibc so that my previous version of the fix also fails with a cyclic dependency. This revision is now accepted and ready to land.Jun 3 2020, 10:33 AM Comment Actions Committed as https://github.com/llvm/llvm-project/commit/8d74de9de6d6cca552d7de7d0bfd36b6dd7d58dc. I thought I had added a "Differential Revision:" to the commit message, but something must have gone wrong.
Revision Contents
Diff 267144 clang/include/clang/Lex/ModuleMap.h
clang/lib/Lex/HeaderSearch.cpp
clang/lib/Lex/ModuleMap.cpp
clang/test/Modules/Inputs/no-undeclared-includes-builtins/system_module/module.modulemap
clang/test/Modules/Inputs/no-undeclared-includes-builtins/system_module/stddef.h
clang/test/Modules/Inputs/no-undeclared-includes-builtins/user_module/module.modulemap
clang/test/Modules/Inputs/no-undeclared-includes-builtins/user_module/user_module.h
clang/test/Modules/no-undeclared-includes-builtins.cpp
|