~shimon/dismaltc

ref: 461e0617cb03f1d5027af4fbb3da0722791022e9 dismaltc/clang/disable-test/SemaCUDA/no-destructor-overload.cu -rw-r--r-- 1.1 KiB
461e0617Itoh Shimon re-enable tests. 1 year, 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fcuda-is-device -fsyntax-only -verify %s

#include "Inputs/cuda.h"

// We don't allow destructors to be overloaded.  Making this work would be a
// giant change to clang, and the use cases seem quite limited.

struct A {
  ~A() {} // expected-note {{previous definition is here}}
  __device__ ~A() {} // expected-error {{destructor cannot be redeclared}}
};

struct B {
  __host__ ~B() {} // expected-note {{previous definition is here}}
  __host__ __device__ ~B() {} // expected-error {{destructor cannot be redeclared}}
};

struct C {
  __host__ __device__ ~C() {} // expected-note {{previous definition is here}}
  __host__ ~C() {} // expected-error {{destructor cannot be redeclared}}
};

struct D {
  __device__ ~D() {} // expected-note {{previous definition is here}}
  __host__ __device__ ~D() {} // expected-error {{destructor cannot be redeclared}}
};

struct E {
  __host__ __device__ ~E() {} // expected-note {{previous definition is here}}
  __device__ ~E() {} // expected-error {{destructor cannot be redeclared}}
};