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
6 #include "Inputs/cuda.h"
8 struct In { In() = default; };
9 struct InD { __device__ InD() = default; };
10 struct InH { __host__ InH() = default; };
11 struct InHD { __host__ __device__ InHD() = default; };
13 struct Out { Out(); };
14 struct OutD { __device__ OutD(); };
15 struct OutH { __host__ OutH(); };
16 struct OutHD { __host__ __device__ OutHD(); };
19 __device__ OutD::OutD() = default;
20 __host__ OutH::OutH() = default;
21 __host__ __device__ OutHD::OutHD() = default;
23 __device__ void fd() {
26 InH inh; // expected-error{{no matching constructor for initialization of 'InH'}}
28 Out out; // expected-error{{no matching constructor for initialization of 'Out'}}
30 OutH outh; // expected-error{{no matching constructor for initialization of 'OutH'}}
36 InD ind; // expected-error{{no matching constructor for initialization of 'InD'}}
40 OutD outd; // expected-error{{no matching constructor for initialization of 'OutD'}}