From 1b30b3c9fa130473df85c4d548e5de9ccd7e459c Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 26 May 2010 07:10:06 +0000 Subject: 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 --- clang/test/SemaTemplate/instantiate-expr-2.cpp | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'clang/test/SemaTemplate/instantiate-expr-2.cpp') 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 + struct meta { + typedef T type; + }; + + struct X { + struct dummy; + + template + X(T, typename meta::type = 0); + + template + X(T, A); + }; + + template + struct Z { }; + + template Z g(T); + + struct Y { + template + void f(T t) { + new X(g(*this)); + } + }; + + template void Y::f(int); +} + namespace N13 { class A{ A(const A&); -- cgit v1.2.3