diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-02 17:18:33 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-02 17:18:33 +0000 |
commit | 9bc6b7fc5318dc3e9b8072e18cd5765e985cbc3a (patch) | |
tree | 2055072680cae04cfcc96c1c7da72b11aee3ebed /clang/test/SemaTemplate/instantiate-init.cpp | |
parent | d520eabcb9d1e929624a1adbcf46e5d523326e81 (diff) | |
download | bcm5719-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.cpp | 11 |
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; +} |