summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExprObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaExprObjC.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp
index c4f01c093a7..cc17e6b890d 100644
--- a/clang/lib/Sema/SemaExprObjC.cpp
+++ b/clang/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()) {
OpenPOWER on IntegriCloud