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++/15567] New: pty of derived class w/ using base::method doesn't print base::method


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

            Bug ID: 15567
           Summary: pty of derived class w/ using base::method doesn't
                    print base::method
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: dje at google dot com

Seems like I should be able to tell from that output of "pty derived" that
"p d->foo (0)" will invoke base's foo and not derived's foo,
without having to look at the source to see the "using".

[Note: Due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57519
compiling this may not produce the expected dwarf.
Attached is a hacked copy.]

class base
{
 public:
  int foo (int x) { return x; }
};

class derived : base
{
 public:
  using base::foo;
  double foo (double x) { return x; }
};

int
main ()
{
  derived *d = new derived;
  return d->foo (0);
}

(gdb) start
(gdb) pty d
type = class derived : private base {
  public:
    double foo(double);
} *

-- 
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]