summaryrefslogtreecommitdiffstats
path: root/clang/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
commit9bc6b7fc5318dc3e9b8072e18cd5765e985cbc3a (patch)
tree2055072680cae04cfcc96c1c7da72b11aee3ebed /clang/test/SemaTemplate/instantiate-init.cpp
parentd520eabcb9d1e929624a1adbcf46e5d523326e81 (diff)
downloadbcm5719-llvm-9bc6b7fc5318dc3e9b8072e18cd5765e985cbc3a.tar.gz
bcm5719-llvm-9bc6b7fc5318dc3e9b8072e18cd5765e985cbc3a.zip
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. llvm-svn: 97568
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-init.cpp')
-rw-r--r--clang/test/SemaTemplate/instantiate-init.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-init.cpp b/clang/test/SemaTemplate/instantiate-init.cpp
index 8a10a87e610..16ecc4758ab 100644
--- a/clang/test/SemaTemplate/instantiate-init.cpp
+++ b/clang/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;
+}
OpenPOWER on IntegriCloud