xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjCXX/delay-parsing-cplusfuncs.mm (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -Werror -verify -Wno-objc-root-class %s
2*f4a2713aSLionel Sambuc// expected-no-diagnostics
3*f4a2713aSLionel Sambuc// rdar://10387088
4*f4a2713aSLionel Sambuc
5*f4a2713aSLionel Sambuc@interface MyClass
6*f4a2713aSLionel Sambuc- (void)someMethod;
7*f4a2713aSLionel Sambuc@end
8*f4a2713aSLionel Sambuc
9*f4a2713aSLionel Sambucstruct S {
10*f4a2713aSLionel Sambuc  int bar(MyClass * myObject);
11*f4a2713aSLionel Sambuc
12*f4a2713aSLionel Sambuc  int gorfbar(MyClass * myObject);
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc  S();
15*f4a2713aSLionel Sambuc  S(MyClass *O1, MyClass *O2);
16*f4a2713aSLionel Sambuc  S(MyClass *O1);
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc  MyClass * Obj1, *Obj2;
19*f4a2713aSLionel Sambuc
20*f4a2713aSLionel Sambuc};
21*f4a2713aSLionel Sambuc
22*f4a2713aSLionel Sambuc@implementation MyClass
23*f4a2713aSLionel Sambuc- (void)someMethod {
24*f4a2713aSLionel Sambuc    [self privateMethod];  // clang already does not warn here
25*f4a2713aSLionel Sambuc}
26*f4a2713aSLionel Sambuc
27*f4a2713aSLionel Sambucint S::bar(MyClass * myObject) {
28*f4a2713aSLionel Sambuc    [myObject privateMethod];
29*f4a2713aSLionel Sambuc    return gorfbar(myObject);
30*f4a2713aSLionel Sambuc}
31*f4a2713aSLionel Sambuc- (void)privateMethod { }
32*f4a2713aSLionel Sambuc
33*f4a2713aSLionel Sambucint S::gorfbar(MyClass * myObject) {
34*f4a2713aSLionel Sambuc    [myObject privateMethod];
35*f4a2713aSLionel Sambuc    [myObject privateMethod1];
36*f4a2713aSLionel Sambuc    return getMe + bar(myObject);
37*f4a2713aSLionel Sambuc}
38*f4a2713aSLionel Sambuc
39*f4a2713aSLionel SambucS::S(MyClass *O1, MyClass *O2) : Obj1(O1), Obj2(O2) {
40*f4a2713aSLionel Sambuc    [O1 privateMethod];
41*f4a2713aSLionel Sambuc    [O2 privateMethod1];
42*f4a2713aSLionel Sambuc}
43*f4a2713aSLionel SambucS::S(MyClass *O1) : Obj1(O1){ Obj2 = 0; }
44*f4a2713aSLionel Sambuc
45*f4a2713aSLionel SambucS::S() {}
46*f4a2713aSLionel Sambuc
47*f4a2713aSLionel Sambuc- (void)privateMethod1 {
48*f4a2713aSLionel Sambuc  getMe = getMe+1;
49*f4a2713aSLionel Sambuc}
50*f4a2713aSLionel Sambuc
51*f4a2713aSLionel Sambucstatic int getMe;
52*f4a2713aSLionel Sambuc
53*f4a2713aSLionel Sambuc@end
54