Skip to content

feature: Per-module -fmodules-decluse (-fmodules-decluse=<module_name>) #162846

@torarnv

Description

@torarnv

I’m setting up Clang module maps for Qt and thought I’d use -fmodules-decluse to test my work. Unfortunately, enabling -fmodules-decluse results in quite a few errors of this kind:

While building module '_DarwinFoundation2' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:61:
In file included from <module-includes>:1:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/nl_types.h:44:10: error: module _DarwinFoundation2 does not directly depend on a module exporting 'sys/cdefs.h', which is part of indirectly-used module cdefs
   44 | #include <sys/cdefs.h>
      |          ^

Which doesn't seem possible to work around.

As suggesteded in https://discourse.llvm.org/t/fmodules-decluse-resulting-in-errors-from-xcode-sdk/88267 a -fmodules-decluse=<module_name> might be a useful addition to the modules machinery.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:modulesC++20 modules and Clang Header Modules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions