On 9/29/26 2:37 AM, Jakub Jelinek wrote:
On Mon, Sep 28, 2026 at 05:25:55PM -0400, Marek Polacek wrote:
Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/16?

-- >8 --
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.

LGTM.
Yes, OK.

Jason

Reply via email to