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 <[email protected]>: https://gcc.gnu.org/g:94990be76a3230a1e19411d3aaa480c043d01172 commit r16-7715-g94990be76a3230a1e19411d3aaa480c043d01172 Author: Marek Polacek <[email protected]> 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 <[email protected]> Reviewed-by: Jason Merrill <[email protected]>
