Fix a minor typo in the handling of the conditional operator for Objective-C interface pointers

llvm-svn: 60096
This commit is contained in:
Douglas Gregor 2008-11-26 06:43:45 +00:00
parent 002a2cb207
commit 08d96d5182
2 changed files with 5 additions and 1 deletions

View File

@ -1644,7 +1644,7 @@ inline QualType Sema::CheckConditionalOperands( // C99 6.5.15
Context.canAssignObjCInterfaces(LHSIface, RHSIface)) {
compositeType = lexT;
} else if (LHSIface && RHSIface &&
Context.canAssignObjCInterfaces(LHSIface, RHSIface)) {
Context.canAssignObjCInterfaces(RHSIface, LHSIface)) {
compositeType = rexT;
} else if (Context.isObjCIdType(lhptee) ||
Context.isObjCIdType(rhptee)) {

View File

@ -61,3 +61,7 @@ void f9(int cond, id<P0,P1> x0, id<P0,P2> x1) {
void f10(int cond, id<P0,P1> x0, id<P0,P2> x1) {
barP2(cond ? x0 : x1);
}
int f11(int cond, A* a, B* b) {
return (cond? b : a)->x; // expected-error{{'A' does not have a member named 'x'}}
}