[patch] Fix PR c++/8171: Allow comparison of ptr-to-mem-fct of base and derived class

Mark Mitchell mark@codesourcery.com
Sun Apr 23 04:19:00 GMT 2006


Volker Reichelt wrote:

> 	PR c++/8171
> 	* typeck.c (comptypes) <METHOD_TYPE>: Do not fall-through to
> 	FUNCTION_TYPE, but use a slightly modified version: Compare the
> 	class-pointers according to the parameter STRICT.
> 	(build_binary_op) <EQ_EXPR, NE_EXPR>: Allow derived classes when
> 	comparing ptr-to-member-functions.  Strip pointer before calling
> 	comptypes.

This looks like a good start -- but don't you need to convert the
pointers-to-member to a common type before comparing them, if they're
not the same when you start?

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list