aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaCUDA/constexpr-virtual-func.cu
blob: 89d909181cd94d2559b308c70685b291dbda15da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fsyntax-only \
// RUN:            -fcuda-is-device %s
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only %s

// expected-no-diagnostics

#include "Inputs/cuda.h"

class A
{
public:
    constexpr virtual int f() = 0;
};

class B : public A
{
public:
    int f() override
    {
        return 42;
    }
};

int test()
{
    B b;
    return b.f();
}