diff options
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index 695a1beca1..ed6e917f55 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -1018,6 +1018,11 @@ Sema::OwningExprResult Sema::BuildInstanceMessage(ExprArg ReceiverE, else Result = ObjCMessageExpr::Create(Context, ReturnType, LBracLoc, Receiver, Sel, Method, Args, NumArgs, RBracLoc); + if (Context.getLangOptions().CPlusPlus && !ReturnType->isVoidType()) { + if (RequireCompleteType(LBracLoc, ReturnType, + diag::err_illegal_message_expr_incomplete_type)) + return ExprError(); + } return MaybeBindToTemporary(Result); } |