xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjC/receiver-forward-class.m (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -Wreceiver-forward-class -verify %s
2*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -fsyntax-only  -Wreceiver-forward-class -verify %s
3*f4a2713aSLionel Sambuc// rdar://10686120
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambuc@class A; // expected-note {{forward declaration of class here}}
6*f4a2713aSLionel Sambuc
7*f4a2713aSLionel Sambuc@interface B
8*f4a2713aSLionel Sambuc-(int) width; // expected-note {{using}}
9*f4a2713aSLionel Sambuc@end
10*f4a2713aSLionel Sambuc@interface C
11*f4a2713aSLionel Sambuc-(float) width; // expected-note {{also found}}
12*f4a2713aSLionel Sambuc@end
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambucint f0(A *x) {
15*f4a2713aSLionel Sambuc  return [x width]; // expected-warning {{receiver type 'A' for instance message is a forward declaration}} \
16*f4a2713aSLionel Sambuc                    // expected-warning {{multiple methods named 'width' found}} \
17*f4a2713aSLionel Sambuc                    // expected-note {{receiver is treated with 'id' type for purpose of method lookup}}
18*f4a2713aSLionel Sambuc}
19*f4a2713aSLionel Sambuc
20