26 lines · plain
1//RUN: %clang_cc1 %s -triple spir -verify -fsyntax-only2//RUN: %clang_cc1 %s -triple spir -verify -fsyntax-only -DFUNCPTREXT3 4#ifdef FUNCPTREXT5#pragma OPENCL EXTENSION __cl_clang_function_pointers : enable6//expected-no-diagnostics7#endif8 9// Check that pointer to member functions are diagnosed10// unless specific clang extension is enabled.11struct C {12 void f(int n);13};14 15typedef void (C::*p_t)(int);16#ifndef FUNCPTREXT17//expected-error@-2{{pointers to functions are not allowed}}18#endif19 20void test() {21 void (C::*p)(int);22#ifndef FUNCPTREXT23//expected-error@-2{{pointers to functions are not allowed}}24#endif25}26