1 // RUN: %clang_cc1 -x objective-c++ -fcxx-exceptions -fsyntax-only -Werror -verify -Wno-objc-root-class %s
8 BadReturn(MyClass * myObject);
9 int bar(MyClass * myObject);
10 void MemFunc(MyClass * myObject);
15 @implementation MyClass
17 [self privateMethod]; // clang already does not warn here
20 int BadReturn::bar(MyClass * myObject) {
21 [myObject privateMethod];
25 BadReturn::BadReturn(MyClass * myObject) try : CObj(myObject) {
28 [myObject privateMethod];
29 [myObject privateMethod1];
30 getMe = bar(myObject); // expected-error {{cannot refer to a non-static member from the handler of a constructor function try block}}
31 [CObj privateMethod1]; // expected-error {{cannot refer to a non-static member from the handler of a constructor function try block}}
33 i = ei; // expected-error {{cannot refer to a non-static member from the handler of a constructor function try block}}
36 i = 0; // expected-error {{cannot refer to a non-static member from the handler of a constructor function try block}}
41 void BadReturn::MemFunc(MyClass * myObject) try {
44 [myObject privateMethod];
45 [myObject privateMethod1];
46 getMe = bar(myObject);
47 [CObj privateMethod1];
57 - (void)privateMethod { }
59 - (void)privateMethod1 {