1 // RUN
: %clang_cc1 %s -triple spir-unknown-unknown -cl-std
=clc
++ -fsyntax-only -verify
2 // RUN
: %clang_cc1 %s -triple spir-unknown-unknown -cl-std
=clc
++ -fsyntax-only -verify -DFUNCPTREXT
5 #pragma OPENCL EXTENSION __cl_clang_function_pointers
: enable
6 //expected-no-diagnostics
9 // Test that virtual functions and abstract classes are rejected
10 // unless specific clang extension is used.
11 class virtual_functions
{
12 virtual void bad1
() {}
14 //expected-error
@-
2 {{virtual functions are not supported in C
++ for OpenCL
}}
17 virtual void bad2
() = 0;
19 //expected-error
@-
2 {{virtual functions are not supported in C
++ for OpenCL
}}
20 //expected-error
@-
3 {{'bad2
' is not virtual and cannot be declared pure
}}
28 //expected-error
@-
2 {{virtual functions are not supported in C
++ for OpenCL
}}
32 // Test that virtual base classes are allowed.
38 struct B
: virtual A
{
42 struct C
: public virtual A
{
50 kernel void virtual_inheritance
() {