This is the mail archive of the gdb-patches@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]

Re: RFC: fix PR c++/15116


>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:

Tom> Second, overload resolution can actually do a kind of second overload
Tom> resolution, according to the standard.  This is well-formed:

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

A minor note.  It turns out that the example as written actually does
work.  This is because the correct "f" appears first in the CU.
If you swap these two lines, you can make it fail:

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

I've pointed this out in the PR I'm filing.

Tom


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