diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-10-27 23:02:38 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-10-27 23:02:38 +0000 |
commit | db07b3f7cdcb505329c1280d7cf70791739a7cad (patch) | |
tree | 40528634d03690e4ef7227d753bb6626363f698c /lib/Sema/SemaExpr.cpp | |
parent | c4c9045dabfc0f0d37dea1b3eb2992654d5b2db1 (diff) |
Type of a conditional expression with two distinct objective-c
class pointer is the most derived common class of the two.
This is <rdar://problem/7334235>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85337 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index f4e58f07f8..12f1f513d4 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -3525,7 +3525,10 @@ QualType Sema::CheckConditionalOperands(Expr *&Cond, Expr *&LHS, Expr *&RHS, compositeType = Context.getObjCIdType(); } else if (LHSTy->isObjCIdType() || RHSTy->isObjCIdType()) { compositeType = Context.getObjCIdType(); - } else { + } else if (!(compositeType = + Context.areCommonBaseCompatible(LHSOPT, RHSOPT)).isNull()) + ; + else { Diag(QuestionLoc, diag::ext_typecheck_cond_incompatible_operands) << LHSTy << RHSTy << LHS->getSourceRange() << RHS->getSourceRange(); |