From 7ff69269cf13583a981b265d4edee689feb4a830 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 27 May 2009 05:00:47 +0000 Subject: [PATCH] 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 --- lib/Sema/SemaExpr.cpp | 3 +++ 1 file changed, 3 insertions(+) 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)); -- 2.40.0