summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/cxx0x-initializer-constructors.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-05-30 22:40:16 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-05-30 22:40:16 +0000
commite6ca47586d322fccdeb96b9b92763f770a613313 (patch)
tree8e0e07d34f3af535af09f7cb07a79116e153a911 /clang/test/CodeGenCXX/cxx0x-initializer-constructors.cpp
parentc07e8934a035b5cb340364d2c6c8ab4a89e521a9 (diff)
downloadbcm5719-llvm-e6ca47586d322fccdeb96b9b92763f770a613313.tar.gz
bcm5719-llvm-e6ca47586d322fccdeb96b9b92763f770a613313.zip
Walk over MaterializeTemporaryExpr when reverting an initializer to its
syntactic form in template instantiation. Previously, this blocked the reversion and we ended up losing inner CXXBindTemporaryExprs (and thus forgetting to call destructors!). llvm-svn: 182969
Diffstat (limited to 'clang/test/CodeGenCXX/cxx0x-initializer-constructors.cpp')
-rw-r--r--clang/test/CodeGenCXX/cxx0x-initializer-constructors.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/cxx0x-initializer-constructors.cpp b/clang/test/CodeGenCXX/cxx0x-initializer-constructors.cpp
index be5b44df1fe..efbf318b817 100644
--- a/clang/test/CodeGenCXX/cxx0x-initializer-constructors.cpp
+++ b/clang/test/CodeGenCXX/cxx0x-initializer-constructors.cpp
@@ -35,3 +35,19 @@ void fn4() {
// CHECK: call void @_ZN1SC1Eidd(%struct.S* %{{.+}}, i32 1, double 2.000000e+00, double 3.000000e+00)
// CHECK: call void @_ZN1SC1Eidd(%struct.S* %{{.+}}, i32 4, double 5.000000e+00, double 6.000000e+00)
}
+
+namespace TreeTransformBracedInit {
+ struct S {};
+ struct T { T(const S &); T(const T&); ~T(); };
+ void x(const T &);
+ template<typename> void foo(const S &s) {
+ // Instantiation of this expression used to lose the CXXBindTemporaryExpr
+ // node and thus not destroy the temporary.
+ x({s});
+ }
+ template void foo<void>(const S&);
+ // CHECK: define {{.*}} void @_ZN23TreeTransformBracedInit3fooIvEEvRKNS_1SE(
+ // CHECK: call void @_ZN23TreeTransformBracedInit1TC1ERKNS_1SE(
+ // CHECK-NEXT: call void @_ZN23TreeTransformBracedInit1xERKNS_1TE(
+ // CHECK-NEXT: call void @_ZN23TreeTransformBracedInit1TD1Ev(
+}
OpenPOWER on IntegriCloud