[patch] add -Wdelete-non-virtual-dtor

Jason Merrill jason@redhat.com
Fri Jun 3 01:56:00 GMT 2011


On 06/02/2011 06:02 PM, Jonathan Wakely wrote:
> +	      if (!dtor || !DECL_VINDEX (dtor))

Do we really want to warn about the case where the class has no/trivial 
destructor?

> +		  bool abstract = false;
> +		  for (x = TYPE_METHODS (type); x; x = DECL_CHAIN (x))
> +		    if (DECL_PURE_VIRTUAL_P (x))
> +		      {
> +			abstract = true;
> +			break;
> +		      }
> +		  if (abstract)

Just check CLASSTYPE_PURE_VIRTUALS.

Jason



More information about the Gcc-patches mailing list