This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/15169] New: unhandled overload resolution case


http://sourceware.org/bugzilla/show_bug.cgi?id=15169

             Bug #: 15169
           Summary: unhandled overload resolution case
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned@sourceware.org
        ReportedBy: tromey@redhat.com
    Classification: Unclassified


This code is valid c++:

double f(double x) { return x; }
int f(int x) { return x; }

int overload(int x, int (*f)(int)) { return f(x); }

int main()
{
  return overload(0, f);
}


However, gdb does not handle this:

(gdb) p overload(0,f)
Cannot resolve function overload to any overloaded instance

Note that the order of the definitions of "f" matters.
If you change them, this will appear to work, because
gdb will then pick the correct "f" by accident.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]