OSDN Git Service

5fc0d73d375ebfc826d9d13c4818fee2c01062c3
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / obj-c++.dg / method-6.mm
1 /* The following should NOT generate "may not respond to" warnings,
2    since a forward-declared @class (instance) should be treated like a
3    'Class') ('id').  */
4
5 /* { dg-do compile } */
6
7 #include <objc/Object.h>
8
9 @class NotKnown;
10
11 void foo(NotKnown *n) {
12   [NotKnown new];
13   [n nonexistent_method]; /* { dg-warning "no .\\-nonexistent_method. method found" } */
14 }
15
16 /* { dg-warning "Messages without a matching method signature" "" { target *-*-* } 0 } */
17 /* { dg-warning "will be assumed to return .id. and accept" "" { target *-*-* } 0 } */
18 /* { dg-warning ".\.\.\.. as arguments" "" { target *-*-* } 0 } */
19