]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++/reflection: update class_members_of comment
authorMarek Polacek <polacek@redhat.com>
Thu, 22 Jan 2026 17:03:01 +0000 (12:03 -0500)
committerMarek Polacek <polacek@redhat.com>
Thu, 22 Jan 2026 17:03:31 +0000 (12:03 -0500)
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.

gcc/cp/reflect.cc

index 9f979b5c0e7324a2965f47bfa135fc8e7f6914bd..c1173ced16889d1d6d6ca3e6186c39c2ec45aae8 100644 (file)
@@ -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 ())