diff options
Diffstat (limited to 'test/SemaOpenCL/func_ptr.cl')
-rw-r--r-- | test/SemaOpenCL/func_ptr.cl | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/SemaOpenCL/func_ptr.cl b/test/SemaOpenCL/func_ptr.cl index f21a3d3..abeab73 100644 --- a/test/SemaOpenCL/func_ptr.cl +++ b/test/SemaOpenCL/func_ptr.cl @@ -11,6 +11,9 @@ void bar() foo((void*)foo); // expected-error{{taking address of function is not allowed}} foo(&foo); // expected-error{{taking address of function is not allowed}} + // initializing an array with the address of functions is an error + void* vptrarr[2] = {foo, &foo}; // expected-error{{taking address of function is not allowed}} expected-error{{taking address of function is not allowed}} + // just calling a function is correct foo(0); } |