Bug ID: 84837
           Summary: unqualified lookup in friend declaration
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot
          Reporter: nathan at gcc dot
  Target Milestone: ---

Created attachment 43635

in a friend declaration of the form
class B::Y {
  friend int A::X::f (type);
(A & B are namespaces or enclosing classes).  what scopes are searched for

[basic.lookup.unqual]p10, tells us we should search
  class A::X as for member lookup, then if not found perform an unqualified
lookup in the current scope -- that is B::Y, B, ::

We instead search A::X then B::Y then A then ::.

Other compilers also get this wrong in different ways.

The example fails to compile because we find non-types in scopes we should not
have searched.

Reply via email to