diff options
Diffstat (limited to 'clang/test/SemaCUDA')
-rw-r--r-- | clang/test/SemaCUDA/call-overloaded-destructor.cu | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/SemaCUDA/call-overloaded-destructor.cu b/clang/test/SemaCUDA/call-overloaded-destructor.cu new file mode 100644 index 00000000000..24b0e7d330e --- /dev/null +++ b/clang/test/SemaCUDA/call-overloaded-destructor.cu @@ -0,0 +1,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(); +} |