[cfe-commits] r130878 - in /cfe/trunk: include/clang/Sema/Sema.h lib/Sema/Sema.cpp lib/Sema/SemaExpr.cpp test/SemaCXX/member-expr.cpp
John McCall
rjmccall at apple.com
Wed May 4 17:40:57 PDT 2011
On May 4, 2011, at 5:20 PM, Matt Beaumont-Gay wrote:
> On Wed, May 4, 2011 at 15:56, John McCall <rjmccall at apple.com> wrote:
>>
>> On May 4, 2011, at 3:10 PM, Matt Beaumont-Gay wrote:
>>> + if (!FunTy)
>>> + FunTy = ExprTy->getAs<FunctionType>();
>>> + if (!FunTy && ExprTy == Context.BoundMemberTy) {
>>> + // Look for the bound-member type. If it's still overloaded, give up,
>>> + // although we probably should have fallen into the OverloadExpr case above
>>> + // if we actually have an overloaded bound member.
>>> + QualType BoundMemberTy = Expr::findBoundMemberType(&E);
>>> + if (!BoundMemberTy.isNull())
>>> + FunTy = BoundMemberTy->castAs<FunctionType>();
>>
>> For what it's worth, that's not true; if all the functions in an overload set for
>> are non-static member functions, the expression will have BoundMember
>> type. This is a useful case to get right, too, because a lot of common
>> member functions are overloaded, like the STL's begin() and end().
>
> Take a guess who added the original version of this snippet to SemaExpr :)
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?r1=130239&r2=130238&pathrev=130239
I should've paid closer attention, then. :)
> I'm not clear on what part of this you're saying is untrue. FWIW, for
> simple cases involving member functions, we do the right thing:
Well, as long as that's true, it doesn't much matter. I'll look closer on my own.
Thanks!
John.
More information about the cfe-commits
mailing list