aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCUDA/call-overloaded-destructor.cu
blob: 24b0e7d330ea1f7871b042ab6ee76673d7b7004a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// expected-no-diagnostics

// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only -verify %s
// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fsyntax-only -fcuda-is-device -verify %s

#include "Inputs/cuda.h"

struct S {
  __host__ ~S() {}
  __device__ ~S() {}
};

__host__ __device__ void test() {
  S s;
  // This should not crash clang.
  s.~S();
}