[cfe-dev] (Unexpected) Method type

Sebastian Redl sebastian.redl at getdesigned.at
Sun Jan 10 07:07:16 PST 2010


Abramo Bagnara wrote:
> Apart clang behaviour reported above (that I suppose it's definitely a
> bug)
Yes, but not one in the type system.
>  the choice to not have a MethodType (or MemberFunctionType)
> different from FunctionProtoType is deliberate or it's something that
> should be saned?
>   
It's deliberate. I saw no reason to give it a distinct type. A
MemberPointerType to FunctionProtoType is a pointer to member function.
The only place where a member function can appear without a pointer to
it is in call expressions. You can't do anything with the function in
these cases except call it, so the type system gets along just fine.

The bug here is that the validation code for & takes a wrong path and
returns a normal PointerType to FunctionProtoType.

Sebastian



More information about the cfe-dev mailing list