[Bug c++/7302] -Wnon-virtual-dtor should't complain of protected dtor

manu at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Mar 16 15:30:00 GMT 2007



------- Comment #18 from manu at gcc dot gnu dot org  2007-03-16 15:30 -------
(In reply to comment #17)
> Created an attachment (id=13214)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13214&action=view) [edit]
> extended patch against gcc-4.2
> 

Hi Pawel,

if the bug exists in mainline, the patch should be against mainline (I think
this patch will apply to mainline anyway). The patch needs testcases, and it
should be sent to gcc-patches@gcc.gnu.org.

Also,

+       warning (0, "%q#T has virtual functions and accessible"
+                " non-virtual destructor", t)
should be:
+       warning (OPT_Wnon_virtual_dtor, 
+                "%q#T has virtual functions and accessible"
+                " non-virtual destructor", t)

Also
+                       || DECL_FRIENDLIST( TYPE_MAIN_DECL (t)))))))
should be
+                       || DECL_FRIENDLIST (TYPE_MAIN_DECL (t)))))))

Thanks for the patch.


-- 


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



More information about the Gcc-bugs mailing list