1 // RUN: %clang_cc1 -std=gnu++11 -triple nvptx64-unknown-unknown -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -std=gnu++11 -triple nvptx64-unknown-unknown -fcuda-is-device -fsyntax-only -verify %s
5 const CopyableH& operator=(const CopyableH& x) { return *this; }
8 __attribute__((device)) const CopyableD& operator=(const CopyableD x) { return *this; }
14 // expected-note@-3 2 {{candidate function (the implicit copy assignment operator) not viable: call to __host__ function from __device__ function}}
15 // expected-note@-4 2 {{candidate function (the implicit move assignment operator) not viable: call to __host__ function from __device__ function}}
20 // expected-note@-3 2 {{candidate function (the implicit copy assignment operator) not viable: call to __device__ function from __host__ function}}
21 // expected-note@-4 2 {{candidate function (the implicit move assignment operator) not viable: call to __device__ function from __host__ function}}
27 __attribute__((device)) void foo1hd() {
29 a = b; // expected-error {{no viable overloaded}}
33 a = b; // expected-error {{no viable overloaded}}
35 __attribute__((device)) void foo1dd() {
40 void foo2hh(SimpleH &a, SimpleH &b) {
43 __attribute__((device)) void foo2hd(SimpleH &a, SimpleH &b) {
44 a = b; // expected-error {{no viable overloaded}}
46 void foo2dh(SimpleD &a, SimpleD &b) {
47 a = b; // expected-error {{no viable overloaded}}
49 __attribute__((device)) void foo2dd(SimpleD &a, SimpleD &b) {