re PR c++/56059 (SIGSEGV on invalid C++11 code)

PR c++/56059
	* tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
	template args count.

From-SVN: r195377
This commit is contained in:
Jason Merrill 2013-01-22 10:22:16 -05:00 committed by Jason Merrill
parent 0e89cbb2ba
commit 4d8e986c1b
3 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2013-01-21 Jason Merrill <jason@redhat.com>
PR c++/56059
* tree.c (strip_typedefs_expr) [TREE_VEC]: Preserve non-default
template args count.
2013-01-09 Jason Merrill <jason@redhat.com>
PR c++/55893

View File

@ -1338,6 +1338,8 @@ strip_typedefs_expr (tree t)
r = copy_node (t);
for (i = 0; i < n; ++i)
TREE_VEC_ELT (r, i) = VEC_index (tree, vec, i);
SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT
(r, GET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (t));
}
else
r = t;

View File

@ -0,0 +1,16 @@
// PR c++/56059
// { dg-options -std=c++11 }
typedef int Int;
template<typename T> struct baz { };
template<typename T> T bar();
template<typename T, typename ... U>
baz<decltype(bar<Int>(bar<U>() ...))>
foo(); // { dg-error "no match" }
int main()
{
foo<int, int>(); // { dg-error "no match" }
return 0;
}