1 // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
4 void vararg_f(int, ...); // expected-error {{invalid prototype, variadic arguments are not allowed in OpenCL}}
5 void __vararg_f(int, ...);
6 typedef void (*vararg_fptr_t)(int, ...); // expected-error {{invalid prototype, variadic arguments are not allowed in OpenCL}}
7 int printf(__constant const char *st, ...); // expected-error {{invalid prototype, variadic arguments are not allowed in OpenCL}}
14 // declaring a function pointer is an error
15 void (*fptr)(int); // expected-error{{pointers to functions are not allowed}}
17 // taking the address of a function is an error
18 foo((void*)foo); // expected-error{{taking address of function is not allowed}}
19 foo(&foo); // expected-error{{taking address of function is not allowed}}
21 // initializing an array with the address of functions is an error
22 void* vptrarr[2] = {foo, &foo}; // expected-error{{taking address of function is not allowed}} expected-error{{taking address of function is not allowed}}
24 // just calling a function is correct