This is the mail archive of the gdb-prs@sources.redhat.com 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]

c++/1111: ptype prints return value for constructors in templated classes


>Number:         1111
>Category:       c++
>Synopsis:       ptype prints return value for constructors in templated classes
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 03 21:58:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     carlton at math dot stanford dot edu
>Release:        GNU gdb 2003-03-03-cvs
>Organization:
>Environment:
i686-pc-linux-gnu (Red Hat 7.3), GCC 3.1, DWARF-2
>Description:
When doing ptype on a templated class, GDB will print
out constructors as having a return type of void
instead of as having no return type at all.
>How-To-Repeat:
Compile this:

template <typename T>
class C {
public:
  C() {}
};

class D {
public:
  D() {}
};

int main()
{
  C<int> c;
  D d;
}

Then:

jackfruit$ /extra/gdb/mirror/src/gdb/gdb a.out
GNU gdb 2003-03-03-cvs
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) b main
Breakpoint 1 at 0x8048500: file foo.cc, line 14.
(gdb) r
Starting program: /home/carlton/tmp/a.out 

Breakpoint 1, main () at foo.cc:14
14	  C<int> c;
(gdb) ptype C<int>
type = class C<int> {
  public:
    void C(void);
}
(gdb) ptype D
type = class D {
  public:
    D(void);
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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