Make module std; and module std.compat; work with Clang
#5982
+96
−23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds Clang diagnostic suppressions as requested in #5975, and makes the module-related tests work with
clang-cl.Thanks to LLVM-98761 and LLVM-89772,
clang-clunderstands the Clang-style options needed to produce and consume Built Module Interfaces (BMIs). This is good enough for our test purposes.I need to guard a line that calls
source_location::column, because Clang and MSVC produce different values. This isn't specific to modules. The difference can also be found in theP1208R6_source_locationtest.I also need to workaround a bug, where clang thinks the declaration of
_allocain<malloc.h>has conflicting ownership. This looks similar to LLVM-37969, though the trigger is different. I've added a repro to that issue. Note that the bug only affects ARM64/ARM64EC, because<intrin.h>is included in the global module fragment, which includes<malloc.h>on x64/x86.Fixes #5975