Teach global selector lookup to ignore hidden methods, which occur
when the methods are declared in a submodule that has not yet been
imported. Part of <rdar://problem/10634711>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172635 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Modules/method_pool.m b/test/Modules/method_pool.m
index 9574caa..1ba5abd 100644
--- a/test/Modules/method_pool.m
+++ b/test/Modules/method_pool.m
@@ -28,3 +28,21 @@
void testMethod2Again(id object) {
[object method2:1]; // expected-warning{{multiple methods named 'method2:' found}}
}
+
+void testMethod3(id object) {
+ [object method3]; // expected-warning{{instance method '-method3' not found (return type defaults to 'id')}}
+}
+
+@import MethodPoolB.Sub;
+
+void testMethod3Again(id object) {
+ char *str = [object method3]; // okay: only found in MethodPoolB.Sub
+}
+
+@import MethodPoolA.Sub;
+
+void testMethod3AgainAgain(id object) {
+ [object method3]; // expected-warning{{multiple methods named 'method3' found}}
+ // expected-note@2{{using}}
+ // expected-note@2{{also found}}
+}