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++/14688] Mis-matched calling convention on virtual functions accepted without error



------- Comment #3 from massimiliano dot ghilardi at gmail dot com  2006-11-20 14:04 -------
Duplicated Bug 29909 also points out the not-so-obvious case where the
overridden virtual method is actually the automatically-compiler-generated
derived class destructor:

// compile with g++ -Wall -O

class one {
public:
        virtual __attribute((regparm(3))) ~one();
};

class two : public one {
};

int main() { 
        one * o = new two();                                                   
                                                                        delete
o;                                                                             
                                                         return 0;             
                                                                               
                                   }


-- 


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


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