This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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++/7768: __PRETTY_FUNCTION__ for template destructor is wrong


>Number:         7768
>Category:       c++
>Synopsis:       __PRETTY_FUNCTION__ for template destructor is wrong
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 29 18:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Bill Clarke
>Release:        3.1.1
>Organization:
Australian National University
>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
>Description:
__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]

>How-To-Repeat:
compile and run above code with g++
>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]