From: Marek Polacek Date: Thu, 22 Jan 2026 17:03:01 +0000 (-0500) Subject: c++/reflection: update class_members_of comment X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ab314d52bf762059d6c15caf007151381180773;p=thirdparty%2Fgcc.git c++/reflection: update class_members_of comment Explain why TYPE_DECLs in TYPE_FIELDS go at the end. gcc/cp/ChangeLog: * reflect.cc (class_members_of): Update a comment to mention finish_member_declaration. --- diff --git a/gcc/cp/reflect.cc b/gcc/cp/reflect.cc index 9f979b5c0e7..c1173ced168 100644 --- a/gcc/cp/reflect.cc +++ b/gcc/cp/reflect.cc @@ -6621,8 +6621,9 @@ class_members_of (location_t loc, const constexpr_ctx *ctx, tree r, get_reflection_raw (loc, m)); } } - /* TYPE_DECLs in TYPE_FIELDS come after other decls, so for members_of - the declaration order is not preserved. */ + /* TYPE_DECLs in TYPE_FIELDS come after other decls due to the "struct + stat hack" (see finish_member_declaration), so for members_of the + declaration order is not preserved. */ if (kind == METAFN_MEMBERS_OF && elts) elts->qsort (members_cmp); if (kind == METAFN_MEMBERS_OF && !implicitly_declared.is_empty ())