xref: /minix3/external/bsd/llvm/dist/clang/test/SemaObjCXX/static-cast.mm (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 -fsyntax-only -verify %s
2*f4a2713aSLionel Sambuc// expected-no-diagnostics
3*f4a2713aSLionel Sambuc
4*f4a2713aSLionel Sambuc@protocol NSTextViewDelegate;
5*f4a2713aSLionel Sambuc
6*f4a2713aSLionel Sambuc@interface NSResponder @end
7*f4a2713aSLionel Sambuc
8*f4a2713aSLionel Sambucclass AutoreleaseObject
9*f4a2713aSLionel Sambuc{
10*f4a2713aSLionel Sambucpublic:
11*f4a2713aSLionel Sambuc AutoreleaseObject();
12*f4a2713aSLionel Sambuc ~AutoreleaseObject();
13*f4a2713aSLionel Sambuc
14*f4a2713aSLionel Sambuc
15*f4a2713aSLionel Sambuc AutoreleaseObject& operator=(NSResponder* inValue);
16*f4a2713aSLionel Sambuc AutoreleaseObject& operator=(const AutoreleaseObject& inValue);
17*f4a2713aSLionel Sambuc
18*f4a2713aSLionel Sambuc AutoreleaseObject(const AutoreleaseObject& inValue);
19*f4a2713aSLionel Sambuc
20*f4a2713aSLionel Sambuc operator NSResponder*() const;
21*f4a2713aSLionel Sambuc};
22*f4a2713aSLionel Sambuc
23*f4a2713aSLionel Sambuc
24*f4a2713aSLionel Sambucvoid InvokeSaveFocus()
25*f4a2713aSLionel Sambuc{
26*f4a2713aSLionel Sambuc AutoreleaseObject mResolvedFirstResponder;
27*f4a2713aSLionel Sambuc id<NSTextViewDelegate> Mydelegate;
28*f4a2713aSLionel Sambuc mResolvedFirstResponder = static_cast<NSResponder*>(Mydelegate);
29*f4a2713aSLionel Sambuc}
30*f4a2713aSLionel Sambuc
31