gdb/39: C++ constructors show bogus return type

chastain@redhat.com chastain@redhat.com
Mon Mar 12 00:08:00 GMT 2001


>Number:         39
>Category:       gdb
>Synopsis:       C++ constructors show bogus return type
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Mar 12 00:08:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     chastain@redhat.com
>Release:        cvs 2001-03-09
>Organization:
>Environment:
Red Hat Linux 7 native
gcc cvs gcc-3_0-branch 2001-03-09
gdb cvs 2001-03-09
>Description:
gdb shows C++ constructors with return type "void".
This is bogus.  Constructors don't have a return type.
Some test scripts, such as gdb.c++/classes.exp, FAIL on this.

  ptype class A
  type = class A {
    public:
      int a;
      int x;

      A & operator=(A const&);
      void A(A const&);
      void A(A const&);
      void A();
      void A();
  }

Contrast with this output using gcc 2.95.2 and the same
version of gdb:

  ptype class A
  type = class A {
    public:
      int a;
      int x;

      A & operator=(A const &);
      A(A const &);
      A(void);
  }
>How-To-Repeat:
Run the test suite with a v3 compiler and look at the log
for gdb.c++/classes.exp.
>Fix:

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



More information about the Gdb-prs mailing list