aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-08-16 21:51:12 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-08-16 21:51:12 +0000
commit57dae1a312e3f7591e957adc89776ef4bca6a097 (patch)
treeccf4147962aa599626f978ccf11bb817e5d9cbcc /lib
parent50e8ac2369951d200e0d3849465d481f20fbdb62 (diff)
Diagnose assiging to an interface object in
non-fragile abi mode as sizes are not statically known. Fixes radar 8315734. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111191 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaExpr.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 59d0328d6e..42d1599e2e 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -6538,6 +6538,11 @@ Action::OwningExprResult Sema::CreateBuiltinBinOp(SourceLocation OpLoc,
}
if (ResultTy.isNull())
return ExprError();
+ if (ResultTy->isObjCObjectType() && LangOpts.ObjCNonFragileABI) {
+ if (Opc >= BinaryOperator::Assign && Opc <= BinaryOperator::OrAssign)
+ Diag(OpLoc, diag::err_assignment_requires_nonfragile_object)
+ << ResultTy;
+ }
if (CompResultTy.isNull())
return Owned(new (Context) BinaryOperator(lhs, rhs, Opc, ResultTy, OpLoc));
else