https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124200

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Note, for members_of vs. modules there is another problem: we order reflections
in *members_of returned vectors by DECL_UID (because for class queries they are
required to be ordered by the order of declarations - and unfortunately
TYPE_FIELDS are only partially ordered by the order of declarations - and for
namespaces it is nice to have predictable order).
Now, because the standard doesn't say anything about ordering of namespace
queries, if the above patch results in some consistent ordering, not e.g.
dependent on compiler AS randomization, that is fine, but I'm really unsure in
which order TYPE_FIELDS of classes are streamed out and in for modules.
Testcase would be exporting some class like:
struct A {
  int a;
  typedef int b;
  struct C {};
  int foo () { return 42; }
  using D = C;
  long e;
};
and in a TU which imports that do members_of (^^A) and verify the exact order
of the non-synthetized members.

Reply via email to