Commit d1093817 by Paolo Carlini Committed by Paolo Carlini

re PR c++/53305 (internal crash with variadic templates and decltype)

/cp
2012-05-11  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/53305
	* pt.c (tsubst_copy: case PARM_DECL): Return error_mark_node if
	tsubst_decl returns NULL_TREE.
	* cxx-pretty-print.c (pp_cxx_simple_type_specifier): Handle
	BOUND_TEMPLATE_TEMPLATE_PARM.

/testsuite
2012-05-11  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/53305
	* g++.dg/cpp0x/variadic132.C: New.

From-SVN: r187396
parent 5450a88f
2012-05-11 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53305
* pt.c (tsubst_copy: case PARM_DECL): Return error_mark_node if
tsubst_decl returns NULL_TREE.
* cxx-pretty-print.c (pp_cxx_simple_type_specifier): Handle
BOUND_TEMPLATE_TEMPLATE_PARM.
2012-05-10 Paolo Carlini <paolo.carlini@oracle.com> 2012-05-10 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53158 PR c++/53158
......
...@@ -1261,6 +1261,7 @@ pp_cxx_simple_type_specifier (cxx_pretty_printer *pp, tree t) ...@@ -1261,6 +1261,7 @@ pp_cxx_simple_type_specifier (cxx_pretty_printer *pp, tree t)
case TEMPLATE_TYPE_PARM: case TEMPLATE_TYPE_PARM:
case TEMPLATE_TEMPLATE_PARM: case TEMPLATE_TEMPLATE_PARM:
case TEMPLATE_PARM_INDEX: case TEMPLATE_PARM_INDEX:
case BOUND_TEMPLATE_TEMPLATE_PARM:
pp_cxx_unqualified_id (pp, t); pp_cxx_unqualified_id (pp, t);
break; break;
......
...@@ -12066,7 +12066,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) ...@@ -12066,7 +12066,7 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
case PARM_DECL: case PARM_DECL:
r = retrieve_local_specialization (t); r = retrieve_local_specialization (t);
if (r == NULL) if (r == NULL_TREE)
{ {
tree c; tree c;
...@@ -12084,6 +12084,8 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl) ...@@ -12084,6 +12084,8 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)
not the following PARM_DECLs that are chained to T. */ not the following PARM_DECLs that are chained to T. */
c = copy_node (t); c = copy_node (t);
r = tsubst_decl (c, args, complain); r = tsubst_decl (c, args, complain);
if (r == NULL_TREE)
return error_mark_node;
/* Give it the template pattern as its context; its true context /* Give it the template pattern as its context; its true context
hasn't been instantiated yet and this is good enough for hasn't been instantiated yet and this is good enough for
mangling. */ mangling. */
......
2012-05-11 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53305
* g++.dg/cpp0x/variadic132.C: New.
2012-05-10 Paolo Carlini <paolo.carlini@oracle.com> 2012-05-10 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53158 PR c++/53158
......
// PR c++/53305
// { dg-do compile { target c++11 } }
template<class... Ts> struct tuple { };
struct funct
{
template<class... argTs>
int operator()(argTs...);
};
template<class...> class test;
template<template <class...> class tp,
class... arg1Ts, class... arg2Ts>
class test<tp<arg1Ts...>, tp<arg2Ts...>>
{
template<class func, class...arg3Ts>
auto test2(func fun, arg1Ts... arg1s, arg3Ts... arg3s)
-> decltype(fun(arg1s..., arg3s...));
};
int main()
{
test<tuple<>, tuple<char,int>> t2;
t2.test2(funct(), 'a', 2); // { dg-error "no matching function" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment