diff options
author | John McCall <rjmccall@apple.com> | 2011-04-28 02:15:35 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-04-28 02:15:35 +0000 |
commit | 642a75f883e644bcfbb82e7af0313776ad1ce33c (patch) | |
tree | 3a2e5d6969f1dead0e9f4112199b63ccd0b52a90 /test | |
parent | cf5664114eb75c6a5fef2bed1c0f0d0fb19debc9 (diff) |
When block-capturing a variable with a non-trivial destructor,
make sure to mark the destructor. This normally isn't required,
because the destructor should have been marked as part of the
declaration of the local, but it's necessary when the variable
is a parameter because it's the call sites that are responsible
for those destructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130372 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGenCXX/blocks.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/CodeGenCXX/blocks.cpp b/test/CodeGenCXX/blocks.cpp index d66debea2b..a4d5b86565 100644 --- a/test/CodeGenCXX/blocks.cpp +++ b/test/CodeGenCXX/blocks.cpp @@ -87,3 +87,20 @@ namespace test2 { // CHECK: define internal void @__Block_byref_object_dispose // CHECK: call void @_ZN5test21BD1Ev( } + +// rdar://problem/9334739 +// Make sure we mark destructors for parameters captured in blocks. +namespace test3 { + struct A { + A(const A&); + ~A(); + }; + + struct B : A { + }; + + void test(B b) { + extern void consume(void(^)()); + consume(^{ (void) b; }); + } +} |