[Bug c++/124215] [reflection] const pointer type can't find member list
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Feb 26 13:37:02 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124215
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:94990be76a3230a1e19411d3aaa480c043d01172
commit r16-7715-g94990be76a3230a1e19411d3aaa480c043d01172
Author: Marek Polacek <polacek@redhat.com>
Date: Tue Feb 24 13:38:48 2026 -0500
c++/reflection: members_of and cv-qual class types [PR124215]
Here when asking for the members of "^^Test const" we found nothing.
The reason is that members_of_representable_p checks whether
CP_DECL_CONTEXT != c, but if c is a type, it doesn't look at its
TYPE_MAIN_VARIANT. Fixed as per Jakub's suggestion in the PR.
PR c++/124215
gcc/cp/ChangeLog:
* reflect.cc (class_members_of): Use TYPE_MAIN_VARIANT of R.
gcc/testsuite/ChangeLog:
* g++.dg/reflect/members_of9.C: New test.
Co-authored-by: Jakub Jelinek <jakub@redhat.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
More information about the Gcc-bugs
mailing list