aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r--lib/Sema/SemaExprObjC.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp
index ce06abec4d..1feca6d25c 100644
--- a/lib/Sema/SemaExprObjC.cpp
+++ b/lib/Sema/SemaExprObjC.cpp
@@ -216,6 +216,11 @@ bool Sema::CheckMessageArgumentTypes(Expr **Args, unsigned NumArgs,
AssignConvertType Result =
CheckSingleAssignmentConstraints(lhsType, argExpr);
+ if (Result == Incompatible && !getLangOptions().CPlusPlus &&
+ CheckTransparentUnionArgumentConstraints(lhsType, argExpr)
+ == Sema::Compatible)
+ Result = Compatible;
+
if (Args[i] != argExpr) // The expression was converted.
Args[i] = argExpr; // Make sure we store the converted expression.