[llvm-branch-commits] [cfe-branch] r79788 - in /cfe/branches/release_26: lib/Sema/SemaExpr.cpp test/SemaObjC/conditional-expr-5.m

Tanya Lattner tonic at nondot.org
Sat Aug 22 16:36:54 PDT 2009


Author: tbrethou
Date: Sat Aug 22 18:36:53 2009
New Revision: 79788

URL: http://llvm.org/viewvc/llvm-project?rev=79788&view=rev
Log:
Merge 79781 from mainline. 
Type of a ?: expression whose either expression is a built-in 'id'
type is 'id' type.

Added:
    cfe/branches/release_26/test/SemaObjC/conditional-expr-5.m
      - copied unchanged from r79781, cfe/trunk/test/SemaObjC/conditional-expr-5.m
Modified:
    cfe/branches/release_26/lib/Sema/SemaExpr.cpp

Modified: cfe/branches/release_26/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_26/lib/Sema/SemaExpr.cpp?rev=79788&r1=79787&r2=79788&view=diff

==============================================================================
--- cfe/branches/release_26/lib/Sema/SemaExpr.cpp (original)
+++ cfe/branches/release_26/lib/Sema/SemaExpr.cpp Sat Aug 22 18:36:53 2009
@@ -3213,9 +3213,9 @@
     // FIXME: Consider unifying with 'areComparableObjCPointerTypes'.
     // It could return the composite type.
     if (Context.canAssignObjCInterfaces(LHSOPT, RHSOPT)) {
-      compositeType = LHSTy;
+      compositeType = RHSOPT->isObjCBuiltinType() ? RHSTy : LHSTy;
     } else if (Context.canAssignObjCInterfaces(RHSOPT, LHSOPT)) {
-      compositeType = RHSTy;
+      compositeType = LHSOPT->isObjCBuiltinType() ? LHSTy : RHSTy;
     } else if ((LHSTy->isObjCQualifiedIdType() || 
                 RHSTy->isObjCQualifiedIdType()) &&
                 Context.ObjCQualifiedIdTypesAreCompatible(LHSTy, RHSTy, true)) {





More information about the llvm-branch-commits mailing list