summaryrefslogtreecommitdiff
path: root/test/SemaObjCXX/pseudo-destructor.mm
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2015-12-14 19:12:54 +0000
committerJohn McCall <rjmccall@apple.com>2015-12-14 19:12:54 +0000
commit62c8b33f4cfaba0c913a7dfaeb4189e0c7df8244 (patch)
tree5ed4ae14e24e383a638209c61f2362caf0868912 /test/SemaObjCXX/pseudo-destructor.mm
parent38a47d0db0931a870d0044c20d7aca68c19ded38 (diff)
downloadclang-62c8b33f4cfaba0c913a7dfaeb4189e0c7df8244.tar.gz
Allow pseudo-destructor calls on forward-declared Objective-C class pointers.
rdar://18522255 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255531 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaObjCXX/pseudo-destructor.mm')
-rw-r--r--test/SemaObjCXX/pseudo-destructor.mm23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/SemaObjCXX/pseudo-destructor.mm b/test/SemaObjCXX/pseudo-destructor.mm
new file mode 100644
index 0000000000..06570c16b6
--- /dev/null
+++ b/test/SemaObjCXX/pseudo-destructor.mm
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+__attribute__((objc_root_class))
+@interface Root
+@end
+
+@class Forward;
+
+template <class T> void destroyPointer(T *t) {
+ t->~T();
+}
+
+template <class T> void destroyReference(T &t) {
+ t.~T();
+}
+
+template void destroyPointer<Root*>(Root **);
+template void destroyReference<Root*>(Root *&);
+
+// rdar://18522255
+template void destroyPointer<Forward*>(Forward **);
+template void destroyReference<Forward*>(Forward *&);