1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fcuda-is-device -fsyntax-only -verify %s
4 #include "Inputs/cuda.h"
6 // We don't allow destructors to be overloaded. Making this work would be a
7 // giant change to clang, and the use cases seem quite limited.
10 ~A() {} // expected-note {{previous definition is here}}
11 __device__ ~A() {} // expected-error {{destructor cannot be redeclared}}
15 __host__ ~B() {} // expected-note {{previous definition is here}}
16 __host__ __device__ ~B() {} // expected-error {{destructor cannot be redeclared}}
20 __host__ __device__ ~C() {} // expected-note {{previous definition is here}}
21 __host__ ~C() {} // expected-error {{destructor cannot be redeclared}}
25 __device__ ~D() {} // expected-note {{previous definition is here}}
26 __host__ __device__ ~D() {} // expected-error {{destructor cannot be redeclared}}
30 __host__ __device__ ~E() {} // expected-note {{previous definition is here}}
31 __device__ ~E() {} // expected-error {{destructor cannot be redeclared}}