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