Skip to content

Commit 992dedf

Browse files
mohitmishra786daveedvdv-nvidia
authored andcommitted
Move meta.stdh out of include_c++/experimental and define __cpp_lib_reflection. [GH #36]
1 parent bb28522 commit 992dedf

23 files changed

Lines changed: 291 additions & 211 deletions

File tree

‎dev_tools/bin/edg-pack-cpfe-ce‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ def _add_experimental_headers_to_base(tar: tarfile.TarFile,
192192
'''
193193
header_dir = source_dir / 'include_c++' / 'experimental'
194194
if not header_dir.exists():
195-
eprint(f"{header_dir} does not exist")
196-
sys.exit(1)
195+
return
197196

198197
edgpack.add_header_files_to_tar(
199198
tar,

‎include_c++/Changes‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
Version 7.1
2+
3+
10/22/26 [GH #36]
4+
<meta> is no longer in the experimental subdirectory
5+
6+
The <meta> header (meta.stdh) has been moved out of the experimental
7+
subdirectory, so it is now found in the same way as the other headers in
8+
this directory. It also defines the library feature-test macro
9+
__cpp_lib_reflection, with the value 202603L that GCC 16 uses.
10+
11+
12+
-------------------------------------------------------------------------------
113
Version 7.0, September 28, 2026
214

315
No changes.
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,18 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
88
/*
99
meta -- Include file for std::meta facilities
1010

11-
This is an experimental header approximating support for facilities as
12-
described in the C++ committee's paper P2996.
11+
This header approximates support for facilities as described in the C++
12+
committee's paper P2996.
1313
*/
1414
#ifndef __META_STDH
1515
#define __META_STDH
1616

17+
/* The library feature-test macro for reflection, with the value GCC 16
18+
uses. As in GCC, it is defined only when reflection is enabled. */
19+
#if defined(__cpp_impl_reflection) && !defined(__cpp_lib_reflection)
20+
#define __cpp_lib_reflection 202603L
21+
#endif /* defined(__cpp_impl_reflection) && ... */
22+
1723
#include <concepts>
1824
#include <initializer_list>
1925
#include <memory>

‎src/interpret.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20597,7 +20597,7 @@ See do_constexpr_intrinsic_call for the meaning of the parameters.
2059720597

2059820598
/*
2059920599
The enumerators of std::meta::operators, in the order in which
20600-
<experimental/meta> declares them, each paired with the operator-name kind
20600+
<meta> declares them, each paired with the operator-name kind
2060120601
that denotes the same operator in the front end. An enumerator's value is its
2060220602
position in this list, counting from one, and its symbol is the spelling that
2060320603
opname_names records for the operator-name kind, so both directions of the
@@ -20720,7 +20720,7 @@ Implement std::meta::operator_of(info): the std::meta::operators enumerator for
2072020720
the operator function represented by the argument (which may be an operator
2072120721
function or operator function template). The result is stored as the value of
2072220722
that enumerator, whose ordinal matches the enumerator sequence declared in
20723-
<experimental/meta> (the enumeration has an integer underlying type, so the
20723+
<meta> (the enumeration has an integer underlying type, so the
2072420724
value is written in integer form). The evaluation fails if the reflection does
2072520725
not designate an operator function.
2072620726

‎src/macro.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12465,7 +12465,7 @@ command line -D options.
1246512465
} /* if */
1246612466
if (injection_enabled) {
1246712467
/* Likewise for token injection, which the EDG-provided
12468-
<experimental/meta.stdh> header uses to write token sequences. */
12468+
meta.stdh header uses to write token sequences. */
1246912469
(void)enter_predef_macro("1", "__EDG_INJECTION_ENABLED__",
1247012470
/*cannot_be_redefined=*/TRUE,
1247112471
/*ref_suppresses_pch_file=*/FALSE);

‎tests/expectations/edg_x86_32/changes.log‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ EDGcpfe28436.sft.cpp:fp:-DTEST_NUMBER=1:FAIL:[6.8] GNU/clang compatibility: larg
77
EDGcpfe28794.sft.cpp:fp:-DTEST_NUMBER=1:REQUIREMENTS NOT MET:Abort on __builtin_bit_cast in dependent context
88
EDGcpfe8330.sft.cpp:fp:-DTEST_NUMBER=1:FAIL:[4.1] Microsoft compatibility: Calling conventions and pointer-to-member-function
99
EDGcpfe9522.sft.cpp:fp:-DTEST_NUMBER=1:FAIL:[4.1] Microsoft compatibility: __ptr64 on 64-bit targets
10+
GH36.sft.cpp:fp:-DTEST_NUMBER=1 --c++26 --set_flag reflection:REQUIREMENTS NOT MET:[GH #36] <meta> defines __cpp_lib_reflection
1011
GH38.sft.cpp:fn:-DTEST_NUMBER=1 --gnu_version 150200:REQUIREMENTS NOT MET:[GH #38] Integer value limits for a 128-bit host integer representation

‎tests/expectations/edg_x86_32_cp/changes.log‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ EDGcpfe28436.sft.cpp:fp:-DTEST_NUMBER=1:FAIL:[6.8] GNU/clang compatibility: larg
1313
EDGcpfe28794.sft.cpp:fp:-DTEST_NUMBER=1:REQUIREMENTS NOT MET:Abort on __builtin_bit_cast in dependent context
1414
EDGcpfe8330.sft.cpp:fp:-DTEST_NUMBER=1:FAIL:[4.1] Microsoft compatibility: Calling conventions and pointer-to-member-function
1515
EDGcpfe9522.sft.cpp:fp:-DTEST_NUMBER=1:FAIL:[4.1] Microsoft compatibility: __ptr64 on 64-bit targets
16+
GH36.sft.cpp:fp:-DTEST_NUMBER=1 --c++26 --set_flag reflection:REQUIREMENTS NOT MET:[GH #36] <meta> defines __cpp_lib_reflection
1617
GH38.sft.cpp:fn:-DTEST_NUMBER=1 --gnu_version 150200:REQUIREMENTS NOT MET:[GH #38] Integer value limits for a 128-bit host integer representation
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fe_only -DTEST_NUMBER=1 --c++26 --set_flag reflection Test_name.c
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../include_c++/meta.stdh

‎tests/tests/changes/GH36.sft.cpp‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//type:fp
2+
//options:--c++26 --set_flag reflection
3+
//use_system_includes: true
4+
//edg_header_pack: meta
5+
//require:TARG_SUPPORTS_X86_64 1
6+
//remark:[GH #36] <meta> defines __cpp_lib_reflection
7+
// 10/22/26 [GH #36]
8+
//
9+
// The EDG-provided <meta> header defines the library feature-test macro
10+
// __cpp_lib_reflection, with the value GCC 16 uses. The GCC system headers
11+
// that <meta> includes are not accepted for 32-bit targets, so the test
12+
// requires an x86-64 target.
13+
14+
#include <meta>
15+
16+
static_assert(__cpp_lib_reflection == 202603L, "");
17+
static_assert(__cpp_lib_reflection == __cpp_impl_reflection, "");

0 commit comments

Comments
 (0)