1 // RUN: %clang_cc1 -fsyntax-only -verify %s 2 // expected-no-diagnostics 3 4 @protocol NSTextViewDelegate; 5 6 @interface NSResponder @end 7 8 class AutoreleaseObject 9 { 10 public: 11 AutoreleaseObject(); 12 ~AutoreleaseObject(); 13 14 15 AutoreleaseObject& operator=(NSResponder* inValue); 16 AutoreleaseObject& operator=(const AutoreleaseObject& inValue); 17 18 AutoreleaseObject(const AutoreleaseObject& inValue); 19 20 operator NSResponder*() const; 21 }; 22 23 24 void InvokeSaveFocus() 25 { 26 AutoreleaseObject mResolvedFirstResponder; 27 id<NSTextViewDelegate> Mydelegate; 28 mResolvedFirstResponder = static_cast<NSResponder*>(Mydelegate); 29 } 30 31