1 // RUN: %clang_cc1 -funknown-anytype -fsyntax-only -verify %s
4 extern __unknown_anytype test0;
5 extern __unknown_anytype test1();
6 extern __unknown_anytype test2(int);
10 extern __unknown_anytype foo;
12 // TODO: it would be great if the 'cannot initialize' errors
13 // turned into something more interesting. It's just a matter of
14 // making sure that these locations check for placeholder types
17 int x = foo; // expected-error {{cannot initialize}}
18 int y = 0 + foo; // expected-error {{'foo' has unknown type}}
19 return foo; // expected-error {{cannot initialize}}
24 extern __unknown_anytype foo();
26 foo(); // expected-error {{'foo' has unknown return type}}
31 extern __unknown_anytype foo;
33 foo(); // expected-error {{call to unsupported expression with unknown type}}
34 ((void(void)) foo)(); // expected-error {{variable 'foo' with unknown type cannot be given a function type}}
38 // rdar://problem/9899447
40 extern __unknown_anytype test0(...);
41 extern __unknown_anytype test1(...);
44 void (*fn)(int) = (void(*)(int)) test0;
45 int x = (int) test1; // expected-error {{function 'test1' with unknown type must be given a function type}}