Fix ObjCInterfaceDecl::lookupInstanceMethod()/lookupClassMethod() to search in inherited protocols.

Also changed ObjCInterfaceDecl::lookupClassMethod() to look through a categories protocols.

Test/patch submitted by Jean-Daniel Dupas (thanks!).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65526 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaObjC/protocol-lookup-2.m b/test/SemaObjC/protocol-lookup-2.m
new file mode 100644
index 0000000..5d721e5
--- /dev/null
+++ b/test/SemaObjC/protocol-lookup-2.m
@@ -0,0 +1,33 @@
+// RUN: clang -fsyntax-only -verify %s
+@interface NSObject @end
+
+@protocol ProtocolA
+
++ (id)classMethod;
+- (id)instanceMethod;
+
+@end
+
+@protocol ProtocolB <ProtocolA>
+
+@end
+
+@interface Foo : NSObject <ProtocolB>
+
+@end
+
+@interface SubFoo : Foo
+
+@end
+
+@implementation SubFoo
+
++ (id)method {
+  return [super classMethod];
+}
+
+- (id)method {
+  return [super instanceMethod];
+}
+
+@end