2014-07-11 Edward Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / gcc / testsuite / obj-c++.dg / method-4.mm
blobe94f8f1b77096c5ce35e48769c86dd6991f8352e
1 /* Warn about "slightly" mismatched method signatures if 
2    -Wstrict-selector-match is on.  */
4 /* { dg-do compile } */
5 /* { dg-options "-Wstrict-selector-match" } */
7 #include <objc/objc.h>
9 @interface Base
10 - (id) meth1: (Base *)arg1; /* { dg-message "using .\\-\\(id\\)meth1:\\(Base \\*\\)arg1." } */
11 - (id) window;              /* { dg-message "using .\\-\\(id\\)window" } */
12 @end
14 @interface Derived: Base
15 - (id) meth1: (Derived *)arg1; /* { dg-message "also found .\\-\\(id\\)meth1:\\(Derived \\*\\)arg1." } */
16 - (Base *) window;             /* { dg-message "also found .\\-\\(Base \\*\\)window." } */
17 @end
19 void foo(void) {
20   id r;
22   [r meth1:r];  /* { dg-warning "multiple methods named .\\-meth1:. found" } */
23   [r window];   /* { dg-warning "multiple methods named .\\-window. found" } */