Originally, the code would take a lookup result as a member in the current scope
and build a member expression accordingly, if the lookup result was not an
operand of the address operator, or it was a field declaration. However, a field
declaration may come from another class, and cause the issue #58674.
Thus, this patch fixes the issue via checking where does the field declaration
comes from, and if it comes from another class, then marks it as not member in
the current scope. The parent scopes of the current scope are also checked, as
the current scope may be associated to a lambda or friend declaration.
So what I was asking above: You're making a ton of changes to this section, without properly updating the comment that is trying to explain what is happening. Please update this to match, particularly the bit around the % operands.