Debian Codegraph @

clang/test/SemaCUDA/default-ctor.cu

raw
1 // RUN: %clang_cc1 -std=c++11 -triple nvptx64-nvidia-cuda -fsyntax-only \
2 // RUN: -fcuda-is-device -verify -verify-ignore-unexpected=note %s
3 // RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-linux-gnu -fsyntax-only \
4 // RUN: -verify -verify-ignore-unexpected=note %s
5
6 #include "Inputs/cuda.h"
7
8 struct In { In() = default; };
9 struct InD { __device__ InD() = default; };
10 struct InH { __host__ InH() = default; };
11 struct InHD { __host__ __device__ InHD() = default; };
12
13 struct Out { Out(); };
14 struct OutD { __device__ OutD(); };
15 struct OutH { __host__ OutH(); };
16 struct OutHD { __host__ __device__ OutHD(); };
17
18 Out::Out() = default;
19 __device__ OutD::OutD() = default;
20 __host__ OutH::OutH() = default;
21 __host__ __device__ OutHD::OutHD() = default;
22
23 __device__ void fd() {
24 In in;
25 InD ind;
26 InH inh; // expected-error{{no matching constructor for initialization of 'InH'}}
27 InHD inhd;
28 Out out; // expected-error{{no matching constructor for initialization of 'Out'}}
29 OutD outd;
30 OutH outh; // expected-error{{no matching constructor for initialization of 'OutH'}}
31 OutHD outhd;
32 }
33
34 __host__ void fh() {
35 In in;
36 InD ind; // expected-error{{no matching constructor for initialization of 'InD'}}
37 InH inh;
38 InHD inhd;
39 Out out;
40 OutD outd; // expected-error{{no matching constructor for initialization of 'OutD'}}
41 OutH outh;
42 OutHD outhd;
43 }