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