diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-26 07:10:06 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-26 07:10:06 +0000 |
commit | 1b30b3c9fa130473df85c4d548e5de9ccd7e459c (patch) | |
tree | cd044bfe6859941f5f102dcb78b511c535fc9fb6 /clang/test/SemaTemplate/instantiate-expr-2.cpp | |
parent | 870e5759e7af8eefafa93332a279e1ef25c27eed (diff) | |
download | bcm5719-llvm-1b30b3c9fa130473df85c4d548e5de9ccd7e459c.tar.gz bcm5719-llvm-1b30b3c9fa130473df85c4d548e5de9ccd7e459c.zip |
When transforming a C++ "new" expression's constructor arguments, drop
any arguments that are default-argument expressions. The can show up
when we have a new expression whose constructor arguments are not
type-dependent and whose allocated type is not dependent and has a
constructor with default arguments. Fixes PR7202.
llvm-svn: 104690
Diffstat (limited to 'clang/test/SemaTemplate/instantiate-expr-2.cpp')
-rw-r--r-- | clang/test/SemaTemplate/instantiate-expr-2.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiate-expr-2.cpp b/clang/test/SemaTemplate/instantiate-expr-2.cpp index b91b398a80e..eaa68ddea90 100644 --- a/clang/test/SemaTemplate/instantiate-expr-2.cpp +++ b/clang/test/SemaTemplate/instantiate-expr-2.cpp @@ -194,6 +194,37 @@ namespace N12 { void f0(int **a) { C::f0(a); } } +namespace PR7202 { + template<typename U, typename T> + struct meta { + typedef T type; + }; + + struct X { + struct dummy; + + template<typename T> + X(T, typename meta<T, dummy*>::type = 0); + + template<typename T, typename A> + X(T, A); + }; + + template<typename T> + struct Z { }; + + template<typename T> Z<T> g(T); + + struct Y { + template<typename T> + void f(T t) { + new X(g(*this)); + } + }; + + template void Y::f(int); +} + namespace N13 { class A{ A(const A&); |