• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -fcuda-is-device -fsyntax-only -verify %s
3 
4 #include "Inputs/cuda.h"
5 
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.
8 
9 struct A {
~AA10   ~A() {} // expected-note {{previous definition is here}}
~AA11   __device__ ~A() {} // expected-error {{destructor cannot be redeclared}}
12 };
13 
14 struct B {
~BB15   __host__ ~B() {} // expected-note {{previous definition is here}}
~BB16   __host__ __device__ ~B() {} // expected-error {{destructor cannot be redeclared}}
17 };
18 
19 struct C {
~CC20   __host__ __device__ ~C() {} // expected-note {{previous definition is here}}
~CC21   __host__ ~C() {} // expected-error {{destructor cannot be redeclared}}
22 };
23 
24 struct D {
~DD25   __device__ ~D() {} // expected-note {{previous definition is here}}
~DD26   __host__ __device__ ~D() {} // expected-error {{destructor cannot be redeclared}}
27 };
28 
29 struct E {
~EE30   __host__ __device__ ~E() {} // expected-note {{previous definition is here}}
~EE31   __device__ ~E() {} // expected-error {{destructor cannot be redeclared}}
32 };
33 
34