On 9/3/26 2:10 AM, [email protected] wrote:
From: Lunex <[email protected]>

Hope you are well,

So this is patch and here is what it is about -

A 'friend' is not a member but 'this Self &&' only works for members.
GCC missed this check, so it marked the friend as a member
and later crashed with no access info to check.

Now we reject friend functions that use an explicit object parameter,

gcc/cp/ChangeLog:

        PR c++/122258
        * decl.cc (grokdeclarator): Diagnose friend with explicit object
        parameter.

It should be OK for a friend to have an xobj parameter if it's a member of another class. The problem here is that it's a non-member function that the existing check isn't catching.

How does

                if (!ctype
                    && decl_context == NORMAL
                    && (in_namespace
                        || !declarator->declarator->u.id.qualifying_scope))

need to change to cover this case?

Jason

Reply via email to