1 //RUN: %clang_cc1 %s -verify -fsyntax-only -triple spir
2 //RUN: %clang_cc1 %s -verify -fsyntax-only -DFPTREXT -triple spir
5 #pragma OPENCL EXTENSION __cl_clang_function_pointers : enable
8 // References to functions are not allowed.
10 //FIXME: Here we provide incorrect diagnostic.
11 void (&mem)(); //expected-error{{reference to function type cannot have '__generic' qualifier}}
16 //expected-error@-2{{references to functions are not allowed}}
18 //expected-error@-4{{declaration of reference variable 'glob' requires an initializer}}
21 using ref2fct_t = void (&)();
23 //expected-error@-2{{references to functions are not allowed}}
25 typedef void (&ref2fct_t)();
27 //expected-error@-2{{references to functions are not allowed}}
30 void test(void (&par)()) {
32 //expected-error@-2{{references to functions are not allowed}}
36 //expected-error@-2{{references to functions are not allowed}}
38 //expected-error@-4{{declaration of reference variable 'loc' requires an initializer}}
43 //expected-error@-2{{pointers to functions are not allowed}}
45 //expected-error@-4{{declaration of reference variable 'ref2fptr' requires an initializer}}