https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79314

            Bug ID: 79314
           Summary: friend function with qualified name definition
           Product: gcc
           Version: 5.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: litteras at ukr dot net
  Target Milestone: ---

http://eel.is/c++draft/class.friend#6 :
A function can be defined in a friend declaration of a class if and only if the
class is a non-local class ([class.local]), the function name is unqualified,
and the function has namespace scope.

note : can be defined if the function name is unqualified
however, following is acceptable with the compiler :
[ 
   namespace M { void f() ; }   
   namespace G { struct B { friend void M::f() { } } ; }
]
icc output :
"friend_qualified_definition.cxx(10): error: a qualified name is not allowed
for a friend declaration that is a function definition
  namespace G { struct B { friend void M::f() { } } ; }"

Reply via email to