From: Douglas Gregor Date: Wed, 27 May 2009 05:00:47 +0000 (+0000) Subject: Don't drop the computed implicit conversions when building a call to X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ff69269cf13583a981b265d4edee689feb4a830;p=clang Don't drop the computed implicit conversions when building a call to overloaded operator[] or overloaded postfix unary operator (++, --). Thanks to Eli for finding this bug! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72460 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 574955789c..9350caaca4 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -1609,6 +1609,7 @@ Sema::ActOnPostfixUnaryOp(Scope *S, SourceLocation OpLoc, UsualUnaryConversions(FnExpr); Input.release(); + Args[0] = Arg; return Owned(new (Context) CXXOperatorCallExpr(Context, OverOp, FnExpr, Args, 2, ResultTy, OpLoc)); @@ -1725,6 +1726,8 @@ Sema::ActOnArraySubscriptExpr(Scope *S, ExprArg Base, SourceLocation LLoc, Base.release(); Idx.release(); + Args[0] = LHSExp; + Args[1] = RHSExp; return Owned(new (Context) CXXOperatorCallExpr(Context, OO_Subscript, FnExpr, Args, 2, ResultTy, LLoc));