void f(int,int);
void f(int,int,int);

void
g ()
{
  (&f)(1,2,3);
}

gives:
t.cpp: In function ‘void g()’:
t.cpp:7: error: address of overloaded function with no contextual type
information

The C++ standard clause 13.3.1.1 says that '(&f)(...)' is the same as
'(f)(...)',
but the latter works and the former does not.


-- 
           Summary: address-of overloaded function does not work in function
                    call
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andrew dot stubbs at st dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29143

Reply via email to