diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2009-10-14 18:03:49 +0000 |
commit | 4c8b24812ddcd1dedaca343a6d4e76f91f398981 (patch) | |
tree | 137ebebcae16fb0ce7ab4af456992bbd8d22fced /test/CodeGenCXX/delete.cpp | |
parent | 5362a71c02e7d448a8ce98cf00c47e353fba5d04 (diff) |
Notes
Diffstat (limited to 'test/CodeGenCXX/delete.cpp')
-rw-r--r-- | test/CodeGenCXX/delete.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/CodeGenCXX/delete.cpp b/test/CodeGenCXX/delete.cpp new file mode 100644 index 0000000000000..9e3feefefeda7 --- /dev/null +++ b/test/CodeGenCXX/delete.cpp @@ -0,0 +1,37 @@ +// RUN: clang-cc %s -emit-llvm -o %t && + +void t1(int *a) { + delete a; +} + +struct S { + int a; +}; + +// POD types. +void t3(S *s) { + delete s; +} + +// Non-POD +struct T { + ~T(); + int a; +}; + +void t4(T *t) { + // RUN: grep "call void @_ZN1TD1Ev" %t | count 1 + delete t; +} + +// PR5102 +template <typename T> +class A { + operator T *() const; +}; + +void f() { + A<char*> a; + + delete a; +} |