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]

[Bug c++/16516] New: no warning of non-virtual dtor in subclass


Dear G++ Folk,

An astute student found the following example:

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
class foo1 {
public:
    virtual void f1 (void) {}
    virtual ~foo1 (void);
};

class foo2 : public foo1 {
public:
    ~foo2 (void);
};
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

We believe the compiler should at least warn that foo2
has a virtual function, and non-virtual dtor.

Thank you for your time!

ATB,

Aaron Naiman

--
Aaron ("Aharon") Naiman | Jerusalem College of Technology--Machon Lev
  naiman@math.jct.ac.il | http://math.jct.ac.il/~naiman

-- 
           Summary: no warning of non-virtual dtor in subclass
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: naiman at math dot jct dot ac dot il
                CC: gcc-bugs at gcc dot gnu dot org,naiman at math dot jct
                    dot ac dot il


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]