diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2014-06-19 14:45:16 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2014-06-19 14:45:16 +0000 |
commit | 0f99537ecac400c5c6db0eafdc60ef871859d5f6 (patch) | |
tree | b5173e8b8c55442061592eecd0c0e12cadef9f44 /clang/lib/Sema/TreeTransform.h | |
parent | 3813d57929cb9b69b3589d7b9a88dd2b3ee51770 (diff) | |
download | bcm5719-llvm-0f99537ecac400c5c6db0eafdc60ef871859d5f6.tar.gz bcm5719-llvm-0f99537ecac400c5c6db0eafdc60ef871859d5f6.zip |
Fix assertion hit or bogus compiler error in cases when instantiating ObjC property accesses used with overloaded binary operators.
rdar://17153478
llvm-svn: 211270
Diffstat (limited to 'clang/lib/Sema/TreeTransform.h')
-rw-r--r-- | clang/lib/Sema/TreeTransform.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h index 9330070bf66..a1a564e2f27 100644 --- a/clang/lib/Sema/TreeTransform.h +++ b/clang/lib/Sema/TreeTransform.h @@ -9911,6 +9911,24 @@ TreeTransform<Derived>::RebuildCXXOperatorCallExpr(OverloadedOperatorKind Op, Expr *Callee = OrigCallee->IgnoreParenCasts(); bool isPostIncDec = Second && (Op == OO_PlusPlus || Op == OO_MinusMinus); + if (First->getObjectKind() == OK_ObjCProperty) { + BinaryOperatorKind Opc = BinaryOperator::getOverloadedOpcode(Op); + if (BinaryOperator::isAssignmentOp(Opc)) + return SemaRef.checkPseudoObjectAssignment(/*Scope=*/nullptr, OpLoc, Opc, + First, Second); + ExprResult Result = SemaRef.CheckPlaceholderExpr(First); + if (Result.isInvalid()) + return ExprError(); + First = Result.get(); + } + + if (Second && Second->getObjectKind() == OK_ObjCProperty) { + ExprResult Result = SemaRef.CheckPlaceholderExpr(Second); + if (Result.isInvalid()) + return ExprError(); + Second = Result.get(); + } + // Determine whether this should be a builtin operation. if (Op == OO_Subscript) { if (!First->getType()->isOverloadableType() && |