blob: ecf3e74ba79f57693092ef4a07a0e1553701e337 [file] [log] [blame]
Sean Callanan1ce3a6b2012-02-04 01:29:37 +00001// RUN: %clang_cc1 -funknown-anytype -fsyntax-only -fdebugger-support -fdebugger-cast-result-to-id -verify %s
2
3extern __unknown_anytype test0;
4extern __unknown_anytype test1();
5
6void test_unknown_anytype_receiver() {
7 (void)(int)[[test0 unknownMethod] otherUnknownMethod];;
8 (void)(id)[[test1() unknownMethod] otherUnknownMethod];
Douglas Gregorb5af2e92013-03-07 22:57:58 +00009 id x = test0;
10 id y = test1();
Sean Callanan1ce3a6b2012-02-04 01:29:37 +000011}
Fariborz Jahanianc8a322a2012-03-09 18:47:16 +000012
13// rdar://10988847
14@class NSString; // expected-note {{forward declaration of class here}}
15
16void rdar10988847() {
17 id s = [NSString stringWithUTF8String:"foo"]; // expected-warning {{receiver 'NSString' is a forward class and corresponding @interface may not exist}}
18}