blob: d0d7922252e65a761f017963f0aaff4d00dd9817 [file] [log] [blame]
Fariborz Jahanianbe1d4ec2012-08-10 15:54:40 +00001// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -Werror -verify -Wno-objc-root-class %s
Andy Gibbs8e8fb3b2012-10-19 12:44:48 +00002// expected-no-diagnostics
Fariborz Jahanianbe1d4ec2012-08-10 15:54:40 +00003// rdar://10387088
4
5@interface MyClass
6- (void)someMethod;
7@end
8
9struct S {
10 int bar(MyClass * myObject);
11
12 int gorfbar(MyClass * myObject);
13
Fariborz Jahanian9e5df312012-08-10 21:15:06 +000014 S();
15 S(MyClass *O1, MyClass *O2);
16 S(MyClass *O1);
17
18 MyClass * Obj1, *Obj2;
19
Fariborz Jahanianbe1d4ec2012-08-10 15:54:40 +000020};
21
22@implementation MyClass
23- (void)someMethod {
24 [self privateMethod]; // clang already does not warn here
25}
26
27int S::bar(MyClass * myObject) {
28 [myObject privateMethod];
29 return gorfbar(myObject);
30}
31- (void)privateMethod { }
32
33int S::gorfbar(MyClass * myObject) {
34 [myObject privateMethod];
35 [myObject privateMethod1];
36 return getMe + bar(myObject);
37}
38
Fariborz Jahanian9e5df312012-08-10 21:15:06 +000039S::S(MyClass *O1, MyClass *O2) : Obj1(O1), Obj2(O2) {
40 [O1 privateMethod];
41 [O2 privateMethod1];
42}
43S::S(MyClass *O1) : Obj1(O1){ Obj2 = 0; }
44
45S::S() {}
46
Fariborz Jahanianbe1d4ec2012-08-10 15:54:40 +000047- (void)privateMethod1 {
48 getMe = getMe+1;
49}
50
51static int getMe;
52
53@end