From 99311ba1a8d4356433518b773986276ee40799a1 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Mon, 16 Aug 2010 21:51:12 +0000 Subject: Diagnose assiging to an interface object in non-fragile abi mode as sizes are not statically known. Fixes radar 8315734. llvm-svn: 111191 --- clang/lib/Sema/SemaExpr.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/Sema/SemaExpr.cpp') diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 59d0328d6e1..42d1599e2e9 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/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 -- cgit v1.2.3