re PR c++/36411 (ICE with invalid template template parameter)

gcc/cp

2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>

	PR c++/36411
	* pt.c (coerce_template_template_parms): Return 0 if parameter
	is error_mark_node.

gcc/testsuite/

2009-02-23  H.J. Lu  <hongjiu.lu@intel.com>

	PR c++/36411
	* g++.dg/template/void14.C: New.

From-SVN: r144396
This commit is contained in:
H.J. Lu 2009-02-23 22:34:50 +00:00 committed by H.J. Lu
parent d8028f2cc3
commit 8c8d4a46a8
4 changed files with 21 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2009-02-23 H.J. Lu <hongjiu.lu@intel.com>
PR c++/36411
* pt.c (coerce_template_template_parms): Return 0 if parameter
is error_mark_node.
2009-02-23 Jason Merrill <jason@redhat.com>
* pt.c (unify): Call maybe_adjust_types_for_deduction when

View File

@ -4756,6 +4756,9 @@ coerce_template_template_parms (tree parm_parms,
{
parm = TREE_VALUE (TREE_VEC_ELT (parm_parms, nparms - 1));
if (parm == error_mark_node)
return 0;
switch (TREE_CODE (parm))
{
case TEMPLATE_DECL:

View File

@ -1,3 +1,8 @@
2009-02-23 H.J. Lu <hongjiu.lu@intel.com>
PR c++/36411
* g++.dg/template/void14.C: New.
2009-02-23 Jason Merrill <jason@redhat.com>
PR c++/38880

View File

@ -0,0 +1,7 @@
// PR c++/36411
// { dg-do compile }
template<template<void> class> struct A // { dg-error "not a valid type" }
{
template<template<int> class T> A<T> foo(); // { dg-error "mismatch|expected|invalid" }
};