https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127643
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-16 branch has been updated by Marek Polacek <[email protected]>: https://gcc.gnu.org/g:0eb7cf727763327fb19a0d4bdaf34ba4f7619484 commit r16-9711-g0eb7cf727763327fb19a0d4bdaf34ba4f7619484 Author: Marek Polacek <[email protected]> Date: Mon Sep 28 16:56:47 2026 -0400 c++/reflection: members_of includes cdtor clones [PR127643] Given struct X { template<class T1, class T2> X(T1, T2); // #1 }; our members_of(^^X) included #1 three times: __ct, and then also the two clones: __ct_comp and __ct_base. In class_members_of we have code to skip DECL_CLONED_FUNCTION_P, but it doesn't cover templates. Do so. PR c++/127643 gcc/cp/ChangeLog: * reflect.cc (class_members_of): Also skip templated clones. gcc/testsuite/ChangeLog: * g++.dg/reflect/members_of18.C: New test. Reviewed-by: Jakub Jelinek <[email protected]> (cherry picked from commit a6c2657fc6aa507315d4ca81573ebb026fae1142)
