Skip to content

C++20 modules available but __cpp_modules not defined #71364

Open
@boris-kolpackov

Description

@boris-kolpackov

While Clang now enables C++20 modules by default with -std=c++20 and later, it does not appear to define the __cpp_modules feature test macros (which should have the value of 201907L; see https://en.cppreference.com/w/cpp/feature_test). I've tested this with up to Clang 18 pre-release (20231102103655+18839aec4ed1).

Is there a reason for omitting this macro for now or is it an oversight that could be fixed? In build2 we currently define this macro on the command line which adds quite a bit of noise.

@iains @ChuanqiXu9 @dwblaikie

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++20clang: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