|
@@ -210,44 +210,11 @@ struct d_h {
|
|
__host__ ~d_h() {} // expected-error {{destructor cannot be redeclared}}
|
|
__host__ ~d_h() {} // expected-error {{destructor cannot be redeclared}}
|
|
};
|
|
};
|
|
|
|
|
|
-// H/D overloading is OK
|
|
|
|
-struct d_dh {
|
|
|
|
- __device__ ~d_dh() {}
|
|
|
|
- __host__ ~d_dh() {}
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
// HD is OK
|
|
// HD is OK
|
|
struct d_hd {
|
|
struct d_hd {
|
|
__host__ __device__ ~d_hd() {}
|
|
__host__ __device__ ~d_hd() {}
|
|
};
|
|
};
|
|
|
|
|
|
-// Mixing H/D and HD is not allowed.
|
|
|
|
-struct d_dhhd {
|
|
|
|
- __device__ ~d_dhhd() {}
|
|
|
|
- __host__ ~d_dhhd() {} // expected-note {{previous declaration is here}}
|
|
|
|
- __host__ __device__ ~d_dhhd() {} // expected-error {{destructor cannot be redeclared}}
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-struct d_hhd {
|
|
|
|
- __host__ ~d_hhd() {} // expected-note {{previous declaration is here}}
|
|
|
|
- __host__ __device__ ~d_hhd() {} // expected-error {{destructor cannot be redeclared}}
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-struct d_hdh {
|
|
|
|
- __host__ __device__ ~d_hdh() {} // expected-note {{previous declaration is here}}
|
|
|
|
- __host__ ~d_hdh() {} // expected-error {{destructor cannot be redeclared}}
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-struct d_dhd {
|
|
|
|
- __device__ ~d_dhd() {} // expected-note {{previous declaration is here}}
|
|
|
|
- __host__ __device__ ~d_dhd() {} // expected-error {{destructor cannot be redeclared}}
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
-struct d_hdd {
|
|
|
|
- __host__ __device__ ~d_hdd() {} // expected-note {{previous declaration is here}}
|
|
|
|
- __device__ ~d_hdd() {} // expected-error {{destructor cannot be redeclared}}
|
|
|
|
-};
|
|
|
|
-
|
|
|
|
// Test overloading of member functions
|
|
// Test overloading of member functions
|
|
struct m_h {
|
|
struct m_h {
|
|
void operator delete(void *ptr); // expected-note {{previous declaration is here}}
|
|
void operator delete(void *ptr); // expected-note {{previous declaration is here}}
|