Add a Clang-specific diagnostic ignore push-pop for `module std;`
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
It seems the MSVC STL module works with clang++.exe (this is the driver with the GNU-like command-line interface, but targets the MSVC ABI). However, the module needs to have additional guards for Clang so that the same warnings of having #include <angle> and defining module std are suppressed. The core of it is:
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Winclude-angled-in-module-purview"
#pragma clang diagnostic ignored "-Wreserved-module-identifier"
#endif
...
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
But I suspect we need to be much more judicious about the macro guards, because clang-cl.exe disguises itself as MSVC to source code, with the exception that __clang__ is also defined.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at stl/modules/std.ixx around lines 39–40 and compare how clang++.exe and clang-cl.exe define compiler macros. Reproduce the module warnings for the angle-bracket include and module name, then determine guards that suppress them for Clang without changing MSVC behavior; done means both diagnostics are appropriately scoped and the warning-free module remains compatible with both drivers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100