summaryrefslogtreecommitdiff
path: root/test/SemaTemplate/instantiate-init.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-03-02 17:18:33 +0000
committerDouglas Gregor <dgregor@apple.com>2010-03-02 17:18:33 +0000
commit91be6f5ccbde073e592bed9a3e3bc363957714fb (patch)
tree4a9d04d80faad8aa84d830370f0222066afe2313 /test/SemaTemplate/instantiate-init.cpp
parenta1359ba1a50d833d55a680ccdc8128d16b399052 (diff)
Use CXXTemporaryObjectExpr for explicitly-constructed temporaries. We
used to do this, but it got lost when we switched functional-style cast syntax over to using the new initialization code. Fixes PR6457. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97568 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/instantiate-init.cpp')
-rw-r--r--test/SemaTemplate/instantiate-init.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiate-init.cpp b/test/SemaTemplate/instantiate-init.cpp
index 8a10a87e61..16ecc4758a 100644
--- a/test/SemaTemplate/instantiate-init.cpp
+++ b/test/SemaTemplate/instantiate-init.cpp
@@ -26,3 +26,14 @@ void test_f1(X0 *x0, int *ip, float *fp, double *dp) {
f1(x0, ip, dp); // expected-note{{instantiation}}
}
+namespace PR6457 {
+ template <typename T> struct X { explicit X(T* p = 0) { }; };
+ template <typename T> struct Y { Y(int, const T& x); };
+ struct A { };
+ template <typename T>
+ struct B {
+ B() : y(0, X<A>()) { }
+ Y<X<A> > y;
+ };
+ B<int> b;
+}