Bug 8216 - ptype prints return value for constructors in templated classes
Summary: ptype prints return value for constructors in templated classes
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-03 21:58 UTC by David Carlton
Modified: 2016-08-30 18:15 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Carlton 2003-03-03 21:58:01 UTC
[Converted from Gnats 1111]

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.

Release:
GNU gdb 2003-03-03-cvs

Environment:
i686-pc-linux-gnu (Red Hat 7.3), GCC 3.1, DWARF-2

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);
}
Comment 1 David Carlton 2003-03-04 17:02:21 UTC
From: carlton@sources.redhat.com
To: gdb-gnats@sourceware.org
Cc:  
Subject: c++/1111
Date: 4 Mar 2003 17:02:21 -0000

 CVSROOT:	/cvs/src
 Module name:	src
 Changes by:	carlton@sourceware.org	2003-03-04 17:02:20
 
 Modified files:
 	gdb/testsuite  : ChangeLog 
 	gdb/testsuite/gdb.c++: templates.exp 
 
 Log message:
 	2003-03-04  David Carlton  <carlton@math.stanford.edu>
 	
 	* gdb.c++/templates.exp (do_tests): Accept valid const in "print
 	Garply<Garply<char> >:: garply".
 	(test_ptype_of_templates): KFAIL "ptype T5<int>" and "ptype t5i"
 	with respect to PR c++/1111; note also PR c++/1113.
 	(test_template_breakpoints): KFAIL "constructor breakpoint" with
 	respect to PR c++/1062.
 	KFAIL "destructor breakpoint" with respect to PR c++/1112.
 
 Patches:
 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.503&r2=1.504
 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.c++/templates.exp.diff?cvsroot=src&r1=1.17&r2=1.18
Comment 2 Keith Seitz 2016-08-30 18:15:07 UTC
This looks like it has been fixed for some time. I have verified that HEAD works correctly, and I am closing this bug.