public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/27519]  New: Another's class destructor name
@ 2006-05-09 15:52 zvonsully at gmail dot com
  2006-05-09 18:34 ` [Bug c++/27519] " fang at csl dot cornell dot edu
  2006-05-10  8:06 ` rguenth at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: zvonsully at gmail dot com @ 2006-05-09 15:52 UTC (permalink / raw)
  To: gcc-bugs

if u have 2 classes defined as:

class TPoints
        {
        TPoints(const TPoints&);
        TPoints& operator=(const TPoints&);
        friend class TPoligon;
        public:

        TPoints::TPoints(){}
        virtual ~TPoints();

        };

class TPoligon: public TPoints
        {
        TPoligon(const TPoligon&);//not impl
        TPoligon& operator=(const TPoligon&);//not impl

        public:

        TPoligon(){}
        virtual ~TPoligon();
        };

//and the functions
TPoints::~TPoligon()// !!!!! <-------- class TPoints and destructor of TPoligon
        {
        }

TPoints::~TPoints(){}

TPoligon::~TPoligon(){}

int main(){}


the code above compiles without warning!


-- 
           Summary: Another's class destructor name
           Product: gcc
           Version: 4.0.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: zvonsully at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27519


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/27519] Another's class destructor name
  2006-05-09 15:52 [Bug c++/27519] New: Another's class destructor name zvonsully at gmail dot com
@ 2006-05-09 18:34 ` fang at csl dot cornell dot edu
  2006-05-10  8:06 ` rguenth at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: fang at csl dot cornell dot edu @ 2006-05-09 18:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from fang at csl dot cornell dot edu  2006-05-09 18:34 -------
With the following reduced case:

//--------->8 snip 8<-------------
class TPoints {
public:
~TPoints();
};

class TPoligon: public TPoints {
public:
~TPoligon();
};

TPoints::~TPoligon() { }

TPoints::~TPoints(){}
//--------->8 snip 8<------------

I get this misleading diagnostic with 4.0.1 (don't have 4.0.3 handy):
dtor.cc:13: error: redefinition of 'TPoints::~TPoints()'
dtor.cc:11: error: 'TPoints::~TPoints()' previously defined here

With 4.1, I get:
dtor.cc:11: error: declaration of '~TPoligon' as member of 'TPoints'


-- 

fang at csl dot cornell dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fang at csl dot cornell dot
                   |                            |edu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27519


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/27519] Another's class destructor name
  2006-05-09 15:52 [Bug c++/27519] New: Another's class destructor name zvonsully at gmail dot com
  2006-05-09 18:34 ` [Bug c++/27519] " fang at csl dot cornell dot edu
@ 2006-05-10  8:06 ` rguenth at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-05-10  8:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2006-05-10 08:06 -------
Fixed in 4.0.3:

/tmp> /space/rguenther/install/gcc-4.0.3/bin/g++ -Wall -S t.C
t.C:11: error: declaration of '~TPoligon' as member of 'TPoints'


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
      Known to fail|                            |4.0.0 4.0.1 4.0.2
      Known to work|4.1.0 4.2.0 3.4.0           |4.1.0 4.2.0 3.4.0 3.4.6
                   |                            |4.0.3
         Resolution|                            |FIXED
   Target Milestone|---                         |4.0.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27519


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-10  8:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-09 15:52 [Bug c++/27519] New: Another's class destructor name zvonsully at gmail dot com
2006-05-09 18:34 ` [Bug c++/27519] " fang at csl dot cornell dot edu
2006-05-10  8:06 ` rguenth at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).