Initialize std_meta_node in init_reflection

This commit is contained in:
Marek Polacek
2026-01-06 15:44:27 -05:00
parent d08fb83ec6
commit cd96edc08d
2 changed files with 6 additions and 10 deletions

View File

@@ -5580,15 +5580,6 @@ cxx_init_decl_processing (void)
/* Create the `std' namespace. */
push_namespace (get_identifier ("std"));
std_node = current_namespace;
if (flag_reflection)
{
/* Note that we haven't initialized void_type_node yet, so
std_meta_node will be initially typeless; its type will be
set a little later in init_reflection. */
push_namespace (get_identifier ("meta"), /*inline*/false);
std_meta_node = current_namespace;
pop_namespace ();
}
pop_namespace ();
flag_noexcept_type = (cxx_dialect >= cxx17);

View File

@@ -57,7 +57,12 @@ init_reflection ()
/* Name it. */
record_builtin_type (RID_MAX, "decltype(^^int)", meta_info_type_node);
TREE_TYPE (std_meta_node) = void_type_node;
/* Create the `std::meta' namespace. */
push_namespace (get_identifier ("std"));
push_namespace (get_identifier ("meta"), /*inline*/false);
std_meta_node = current_namespace;
pop_namespace ();
pop_namespace ();
}
/* Create a REFLECT_EXPR expression of kind KIND around T. */