Bug 7768 - __PRETTY_FUNCTION__ for template destructor is wrong
: __PRETTY_FUNCTION__ for template destructor is wrong
Status: RESOLVED FIXED
Product: gcc
Classification: Unclassified
Component: c++
: 3.1.1
: P3 normal
: ---
Assigned To: Nathan Sidwell
:
:
:
:
  Show dependency treegraph
 
Reported: 2002-08-29 18:56 UTC by Bill Clarke
Modified: 2003-07-25 17:33 UTC (History)
1 user (show)

See Also:
Host: sparc-sun-solaris2.8
Target: sparc-sun-solaris2.8
Build: sparc-sun-solaris2.8
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bill Clarke 2002-08-29 18:56:00 UTC
__PRETTY_FUNCTION__ in a destructor of a template looks like a constructor
that returns void and takes no args:

e.g., this code:
// begins
#include <iostream>

template <typename T>
struct X {
  X() { std::cout << __PRETTY_FUNCTION__ << std::endl; }
  ~X() { std::cout << __PRETTY_FUNCTION__ << std::endl; }
};

int main() {
  { X<int> x;
  }
  return 0;
}
// ends

when compiled and executed produces:
X<T>::X() [with T = int]
void X<T>::X() [with T = int]

Release:
3.1.1

Environment:
System: SunOS bullet 5.8 Generic_108528-15 sun4u sparc SUNW,Ultra-5_10
Architecture: sun4

	
host: sparc-sun-solaris2.8
build: sparc-sun-solaris2.8
target: sparc-sun-solaris2.8
configured with: ../gcc-3.1.1/configure --with-cpu=ultrasparc --enable-lanaguages=c,c++,f77 : (reconfigured) ../gcc-3.1.1/configure --with-cpu=ultrasparc --enable-languages=c,c++,f77

How-To-Repeat:
compile and run above code with g++
Comment 1 Nathan Sidwell 2002-09-13 13:41:11 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: confirmed
Comment 2 Nathan Sidwell 2002-09-14 12:17:02 UTC
Responsible-Changed-From-To: unassigned->nathan
Responsible-Changed-Why: patching
Comment 3 Nathan Sidwell 2002-09-14 16:24:31 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: 2002-09-14  Nathan Sidwell  <nathan@codesourcery.com>
    
            PR c++/7768
            * pt.c (build_template_decl): Copy DECL_DESTRUCTOR_P.
Comment 4 Nathan Sidwell 2002-09-14 23:19:48 UTC
From: nathan@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/7768
Date: 14 Sep 2002 23:19:48 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	nathan@gcc.gnu.org	2002-09-14 16:19:48
 
 Modified files:
 	gcc/cp         : ChangeLog pt.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/template: pretty1.C 
 
 Log message:
 	cp:
 	PR c++/7768
 	* pt.c (build_template_decl): Copy DECL_DESTRUCTOR_P.
 	testsuite:
 	* g++.dg/template/pretty1.C: New test
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.2955&r2=1.2956
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.613&r2=1.614
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2069&r2=1.2070
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/pretty1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1