Bug 9622 - [3.2 regression] __PRETTY_FUNCTION__ incorrect in template dtors
Summary: [3.2 regression] __PRETTY_FUNCTION__ incorrect in template dtors
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.2.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2003-02-08 00:06 UTC by jamagallon
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
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 jamagallon 2003-02-08 00:06:00 UTC
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)
Comment 1 Wolfgang Bangerth 2003-02-08 00:28:06 UTC
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
Comment 2 Danny Smith 2003-02-08 07:29:02 UTC
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
 
Comment 3 Joe Buck 2003-04-25 21:14:12 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: Fixed for 3.3.