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++/15505] pure virtual destructor not overloaded, but accepted


------- Additional Comments From bangerth at dealii dot org  2004-05-17 23:07 -------
Since you don't explicitly declare the existence of a user-defined 
destructor in the derived class, the compiler synthesizes it automatically 
for you. Thus, the derived class does have a final implementation of the 
pure virtual function. This explains why the compiler (correctly) accepts 
your code. 
 
The standard allows to declare pure destructors, but since base classes  
have to be destroyed anyway, you have to define it in addition. The lack 
of a definition explains why the linker (correctly) complains about a 
function definition. 
 
Thus, your code is invalid and gcc is right, sorry. 
 
Wolfgang 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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