Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CUDA] Don't assume that destructors can't be overloaded.
Summary: You can overload a destructor in CUDA, and SemaOverload needs to be tweaked not to crash when it sees an explicit call to an overloaded destructor. Reviewers: rsmith Subscribers: cfe-commits, tra Differential Revision: http://reviews.llvm.org/D21912 llvm-svn: 275231
- Loading branch information
Justin Lebar
committed
Jul 12, 2016
1 parent
51078b8
commit d35f706
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} |