EGCS 1.1a: unreasonable/incorrect casting restriction

Keith Hanlan keithh@nortel.ca
Thu Sep 3 15:10:00 GMT 1998


'jason@cygnus.com' writes:

>I wrote:
>
> > A change has been made to the casting rules in EGCS 1.1a
> > since EGCS 1.03a. Previously, the following code compiled
> > without problem.
>
> > Now EGCS 1.1a complains:
> > /rbbvobs/xems/include/ovobject.hh:171: could not convert template argument `OVwDbFreeFieldValue(OVwFieldValue *)' to `void (*)(void *)'
>
> > Why not?
>
>There are no implicit conversions between function types.  You'll need a cast.

Thanks for the reply Jason. But could you please elaborate?
What's implicit about:
   typedef MyAutoPtr <OVwFieldValue, 
		      reinterpret_cast<Deleter>(OVwDbFreeFieldValue)> 
					   OVwFieldValue_auto_ptr;
or
   typedef MyAutoPtr <OVwFieldValue, 
		      (Deleter)OVwDbFreeFieldValue> 
					   OVwFieldValue_auto_ptr;

Both of which fail identically.

Regards,
Keith Hanlan    KeithH@nortel.ca   NORTEL Ottawa, Canada  1-613-765-4645



More information about the Gcc-bugs mailing list