Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] CPPFunctionType - method or function?


Sergey,
As far as I remember, the implicit this parameter for member functions is only considered for resolution of overloaded functions.  This is really only because the set of function can contain both members and nonmembers.  It is not considered in any other place where we may be comparing function types.  This is handled by the resolveFunction method without the function type knowning anything about it.  

I'm afraid I'm too long out of things to give any concrete advice.  I'd guess the getExpressionType is too recursive to get anything from the method binding, which implies you will need to either add a field to CPPFunctionType, or perhaps create a CPPMethodType.  If you create a CPPMethodType, what does this mean (if anything) for CPPPointerToMemberType?  

-Andrew


"Sergey Prigogin" <eclipse.sprigogin@xxxxxxxxx>
Sent by: cdt-dev-bounces@xxxxxxxxxxx

05/13/2008 08:44 AM

Please respond to
"CDT General developers list." <cdt-dev@xxxxxxxxxxx>

To
Andrew Niefer/Ottawa/IBM@IBMCA
cc
"CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Subject
[cdt-dev] CPPFunctionType - method or function?





Andrew, or somebody else,
Could you please help me understand design of CPPFunctionType class. The class seems to be used for both, class methods and standalone functions, but it doesn't make a distinction between the two. I would expect CPPFunctionType to know the type of its

implicit (this) parameter. This would also make it easy to tell apart method and standalone function types, since the latter don't have implicit parameters.

Without making such changes, is there another way to determine if CPPFunctionType describes a method or a function? I need this information to generate either CPPPointerType or CPPPointerToMemberType for the type of _expression_ with unary & operator. See
https://bugs.eclipse.org/bugs/show_bug.cgi?id=201204.


-sergey
_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top