diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc index 526e5344f1f..be4325030f0 100644 --- a/gcc/cp/decl.cc +++ b/gcc/cp/decl.cc @@ -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); diff --git a/gcc/cp/reflect.cc b/gcc/cp/reflect.cc index 6eeeb945938..e98d58a5495 100644 --- a/gcc/cp/reflect.cc +++ b/gcc/cp/reflect.cc @@ -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. */