Skip to content

[GNATS 27251] Reflection: Add __cpp_reflection feature macro #36

Closed

Description

@jhsedg

Description

​Peter Dimov suggests we initialize it to something like 20240512 for now.

Activity

  1. mohitmishra786 commented on Oct 10, 2026

    @mohitmishra786
    Contributor

    @nv-cmeerw @wchilders-nvidia @daveedvdv-nvidia

    I was looking at this one, and I think most of it is already covered on main:

    • When reflection is enabled, the front end predefines __cpp_impl_reflection as 202603L (src/macro.c#L4823-L4827). It was added in 4b04de5 as part of the GCC 16.1 <meta> work (Changes entry for EDGcpfe/28999).
    • P2996R13 has no __cpp_reflection macro. Section 5.3 adds __cpp_impl_reflection to [cpp.predefined] and __cpp_lib_reflection to [version.syn] (also defined in <meta>).

    One part that may still be open: nothing in the tree defines __cpp_lib_reflection. With GCC 16.1 that comes from libstdc++'s <meta>, but our own include_c++/experimental/meta.stdh doesn't define it.

    Can this issue be closed, or should meta.stdh define __cpp_lib_reflection (and if so, with which value)? If something is still needed, I can take it up, so please assign it to me.

  2. daveedvdv-nvidia commented on Oct 21, 2026

    @daveedvdv-nvidia
    Contributor

    Yes, let's add __cpp_lib_reflection and define it to what ever GCC 16.x defines it to. I'd also use this issue to move meta.stdh to include_c++ (i.e., no longer under experimental/) since this feature is now quasi-standard.

  3. added a commit that references this issue on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions