Handle destruction of temporaries used in default argument
construction of constructor calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78222 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenCXX/default-arg-temps.cpp b/test/CodeGenCXX/default-arg-temps.cpp
index 2dcf773..2651446 100644
--- a/test/CodeGenCXX/default-arg-temps.cpp
+++ b/test/CodeGenCXX/default-arg-temps.cpp
@@ -7,9 +7,19 @@
void f(const T& t = T());
+class X { // ...
+public:
+ X();
+ X(const X&, const T& t = T());
+};
+
void g() {
- // RUN: grep "call void @_ZN1TC1Ev" %t | count 2 &&
- // RUN: grep "call void @_ZN1TD1Ev" %t | count 2
+ // RUN: grep "call void @_ZN1TC1Ev" %t | count 4 &&
+ // RUN: grep "call void @_ZN1TD1Ev" %t | count 4
f();
f();
+
+ X a;
+ X b(a);
+ X c = a;
}