public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/29602] New: cant use typedef class name of a baseclass
@ 2022-09-22 16:06 blarsen at redhat dot com
  2022-09-27 18:12 ` [Bug c++/29602] " keiths at redhat dot com
  2022-10-03 16:04 ` blarsen at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: blarsen at redhat dot com @ 2022-09-22 16:06 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=29602

            Bug ID: 29602
           Summary: cant use typedef class name of a baseclass
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: blarsen at redhat dot com
  Target Milestone: ---

Consider the following code:
```
class base{
public:
    int x;
};

typedef base tbase;

class derived: public base{
public:
    int y;
};

int main(){
    derived der;
    der.y = 0;
    der.tbase::x = 1;
    return der.tbase::x;
}
```

g++ is able to compile it with no problems, but in GDB I get:
(gdb) 
17          return der.tbase::x;
(gdb) print der.base::x
$1 = 1
(gdb) print der.tbase::x
A syntax error in expression, near `'.

GDB should be able to resolve the typedef in the user expression and find the
correct member.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-03 16:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-22 16:06 [Bug c++/29602] New: cant use typedef class name of a baseclass blarsen at redhat dot com
2022-09-27 18:12 ` [Bug c++/29602] " keiths at redhat dot com
2022-10-03 16:04 ` blarsen at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).