summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaOpenCL/func_ptr.cl
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaOpenCL/func_ptr.cl')
-rw-r--r--clang/test/SemaOpenCL/func_ptr.cl3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/SemaOpenCL/func_ptr.cl b/clang/test/SemaOpenCL/func_ptr.cl
index f21a3d3265a..abeab73a779 100644
--- a/clang/test/SemaOpenCL/func_ptr.cl
+++ b/clang/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);
}
OpenPOWER on IntegriCloud