diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2011-06-01 07:44:31 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2011-06-01 07:44:31 +0000 |
commit | 8d7946151cd15c0e7c34250c122d59b2f5027999 (patch) | |
tree | 00b2eefc8053b9385a63bd722a451c25f25373d8 /test/SemaCXX/return.cpp | |
parent | b68ffb107a86f5e3851e8108c712b64dd16ba258 (diff) |
Even a return statement of an expression with a dependent type in a void
function might need to clean up its temporaries. Fixes PR10057.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132390 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/return.cpp')
-rw-r--r-- | test/SemaCXX/return.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaCXX/return.cpp b/test/SemaCXX/return.cpp index af7f50ce44..f83b55a6ab 100644 --- a/test/SemaCXX/return.cpp +++ b/test/SemaCXX/return.cpp @@ -53,3 +53,14 @@ namespace PR9328 { class foo { operator int * const (); }; + +namespace PR10057 { + struct S { + ~S(); + }; + + template <class VarType> + void Test(const VarType& value) { + return S() = value; + } +} |