simple example: #include <iostream> using namespace std; class A { public: A() { cout << __PRETTY_FUNCTION__ << endl; }; ~A() { cout << __PRETTY_FUNCTION__ << endl; }; }; template<class T> class B { public: B() { cout << __PRETTY_FUNCTION__ << endl; }; ~B() { cout << __PRETTY_FUNCTION__ << endl; }; }; int main() { A a; B<int> b; return 0; } Result: werewolf:~/bug> g++ -O2 bug.cc -o bug werewolf:~/bug> bug A::A() B<T>::B() [with T = int] void B<T>::B() [with T = int] A::~A() Release: 3.2.1 Environment: werewolf:~/bug> gcc --version gcc-3.2.1 (GCC) 3.2.1 (Mandrake Linux 9.1 3.2.1-6mdk)
State-Changed-From-To: open->analyzed State-Changed-Why: Fixed in 3.3 and 3.4, not fixed in 3.2.2. Worked in 2.95: tmp/g> /home/bangerth/bin/gcc-3.3-pre/bin/c++ z.cc tmp/g> ./a.out A::A() B<T>::B() [with T = int] B<T>::~B() [with T = int] A::~A() tmp/g> /home/bangerth/bin/gcc-3.2.2-pre/bin/c++ z.cc tmp/g> ./a.out A::A() B<T>::B() [with T = int] void B<T>::B() [with T = int] A::~A() tmp/g> c++ z.cc tmp/g> ./a.out A::A() B<int>::B() B<int>::~B() A::~A() I think I recall that there was once a report in the bug database about this case. It may contain a clue as to what patch fixed this. If you want, it would be great if you could try to find this patch, and it might go into a possible gcc3.2.3, if such a release ever happens. Thanks Wolfgang
From: Danny Smith <dannysmith@clear.net.nz> To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, jamagallon@able.es, gcc-prs@gcc.gnu.org Cc: Subject: Re: c++/9622: [3.2 regression] __PRETTY_FUNCTION__ incorrect in template dtors Date: Sat, 08 Feb 2003 07:29:02 +0000 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=g cc&pr=9622 This is duplicate of 7768 The audit trail for that PR provides links to the diffs for 3.3. fix. It's a one-liner, applies cleanly to 3.2.2 release and allows the testsuite/g++.dg/template/pretty1.C (added with patch for 7768) to pass on 3.2 branch Danny
State-Changed-From-To: analyzed->closed State-Changed-Why: Fixed for 3.3.