diff options
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index c4f01c093a..cc17e6b890 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -1211,9 +1211,13 @@ ExprResult Sema::BuildInstanceMessage(Expr *Receiver, // and determine receiver type. if (Receiver) { if (Receiver->hasPlaceholderType()) { - ExprResult result = CheckPlaceholderExpr(Receiver); - if (result.isInvalid()) return ExprError(); - Receiver = result.take(); + ExprResult Result; + if (Receiver->getType() == Context.UnknownAnyTy) + Result = forceUnknownAnyToType(Receiver, Context.getObjCIdType()); + else + Result = CheckPlaceholderExpr(Receiver); + if (Result.isInvalid()) return ExprError(); + Receiver = Result.take(); } if (Receiver->isTypeDependent()) { |