summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/temporaries.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-12-24 17:16:46 +0000
committerDouglas Gregor <dgregor@apple.com>2009-12-24 17:16:46 +0000
commitf82bead3fd0d90635830808a420e49960576abde (patch)
tree5259601af89a2f27222ae9971bc100a123495926 /clang/test/CodeGenCXX/temporaries.cpp
parente6212ace38d85cdea0c2decad25a49460047ec15 (diff)
downloadbcm5719-llvm-f82bead3fd0d90635830808a420e49960576abde.tar.gz
bcm5719-llvm-f82bead3fd0d90635830808a420e49960576abde.zip
InitializationSequence handles binding to temporaries, so that
argument-passing doesn't have to. Fixes PR5867, where we were binding a temporary twice in the AST and, therefore, calling its destructor twice. llvm-svn: 92131
Diffstat (limited to 'clang/test/CodeGenCXX/temporaries.cpp')
-rw-r--r--clang/test/CodeGenCXX/temporaries.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/temporaries.cpp b/clang/test/CodeGenCXX/temporaries.cpp
index f83bbeeac80..3fd7cfec786 100644
--- a/clang/test/CodeGenCXX/temporaries.cpp
+++ b/clang/test/CodeGenCXX/temporaries.cpp
@@ -216,3 +216,22 @@ I f12() {
// CHECK: ret void
return "Hello";
}
+
+// PR5867
+namespace PR5867 {
+ struct S {
+ S();
+ S(const S &);
+ ~S();
+ };
+
+ void f(S, int);
+ // CHECK: define void @_ZN6PR58671gEv
+ void g() {
+ // CHECK: call void @_ZN6PR58671SC1Ev
+ // CHECK-NEXT: call void @_ZN6PR58671fENS_1SEi
+ // CHECK-NEXT: call void @_ZN6PR58671SD1Ev
+ // CHECK-NEXT: ret void
+ (f)(S(), 0);
+ }
+}
OpenPOWER on IntegriCloud