build: Fix missing variable quotes and typo
[official-gcc.git] / gcc / testsuite / obj-c++.dg / method-4.mm
blob1f2f93eb93db0768965b1e86833cb09fc018712f
1 /* Warn about "slightly" mismatched method signatures if 
2    -Wstrict-selector-match is on.  */
4 /* { dg-do compile } */
5 /* { dg-options "-Wstrict-selector-match" } */
6 // { dg-additional-options "-Wno-objc-root-class" }
8 #include <objc/objc.h>
10 @interface Base
11 - (id) meth1: (Base *)arg1; /* { dg-message "using .\\-\\(id\\)meth1:\\(Base \\*\\)arg1." } */
12 - (id) window;              /* { dg-message "using .\\-\\(id\\)window" } */
13 @end
15 @interface Derived: Base
16 - (id) meth1: (Derived *)arg1; /* { dg-message "also found .\\-\\(id\\)meth1:\\(Derived \\*\\)arg1." } */
17 - (Base *) window;             /* { dg-message "also found .\\-\\(Base \\*\\)window." } */
18 @end
20 void foo(void) {
21   id r;
23   [r meth1:r];  /* { dg-warning "multiple methods named .\\-meth1:. found" } */
24   [r window];   /* { dg-warning "multiple methods named .\\-window. found" } */