| // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -fsyntax-only -verify |
| // RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=clc++ -fsyntax-only -verify -DFUNCPTREXT |
| #pragma OPENCL EXTENSION __cl_clang_function_pointers : enable |
| //expected-no-diagnostics |
| // Test that virtual functions and abstract classes are rejected |
| // unless specific clang extension is used. |
| class virtual_functions { |
| //expected-error@-2 {{virtual functions are not supported in C++ for OpenCL}} |
| //expected-error@-2 {{virtual functions are not supported in C++ for OpenCL}} |
| //expected-error@-3 {{'bad2' is not virtual and cannot be declared pure}} |
| //expected-error@-2 {{virtual functions are not supported in C++ for OpenCL}} |
| // Test that virtual base classes are allowed. |
| struct C : public virtual A { |
| kernel void virtual_inheritance() { |