[cfe-commits] PATCH: Support access checking for address of overloaded static member functions

John McCall rjmccall at apple.com
Mon Apr 19 10:17:36 PDT 2010


On Apr 17, 2010, at 4:21 AM, Chandler Carruth wrote:
> It seems that address-of access checking for static members was broken in that assumed the name would always be explicitly qualified. Does the attached patch seem like a reasonable way to address this? Is there a better pattern? <static-member-access.patch>

This is wrong.  That calculation is looking for the naming class of the lookup, which in general is not the same as the declaring class.  Fortunately, the OverloadExpr knows the naming class of the lookup, but only on its subclasses.

The most appropriate solution would be to make a getNamingClass on OverloadExpr which defers to the appropriate derived class, then use that for the naming class in the access calculation.

John.



More information about the cfe-commits mailing list