return compositeType;
}
}
-
+ // Need to handle "id<xx>" explicitly. Unlike "id", whose canonical type
+ // evaluates to "struct objc_object *" (and is handled above when comparing
+ // id with statically typed objects). FIXME: Do we need an ImpCastExprToType?
+ if (lexT->isObjCQualifiedIdType() || rexT->isObjCQualifiedIdType()) {
+ if (ObjCQualifiedIdTypesAreCompatible(lexT, rexT, true))
+ return Context.getObjCIdType();
+ }
// Otherwise, the operands are not compatible.
Diag(questionLoc, diag::err_typecheck_cond_incompatible_operands,
lexT.getAsString(), rexT.getAsString(),
--- /dev/null
+// RUN: clang -fsyntax-only -verify -pedantic %s
+@protocol NSObject
+@end
+
+@protocol DTOutputStreams <NSObject>
+@end
+
+@interface DTFilterOutputStream <DTOutputStreams>
+- nextOutputStream;
+@end
+
+@implementation DTFilterOutputStream
+- (id)initWithNextOutputStream:(id <DTOutputStreams>) outputStream {
+ id <DTOutputStreams> nextOutputStream = [self nextOutputStream];
+ self = nextOutputStream;
+ return nextOutputStream ? nextOutputStream : self;
+}
+- nextOutputStream {
+ return self;
+}
+@end