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

/cp
2012-01-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/51402
	* pt.c (lookup_template_class_1): Check context returned by
	tsubst for error_mark_node.

/testsuite
2012-01-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/51402
	* g++.dg/template/crash110.C: New.

From-SVN: r183345
This commit is contained in:
Paolo Carlini 2012-01-20 17:21:19 +00:00 committed by Paolo Carlini
parent bad2e812fe
commit b968b19221
4 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2012-01-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51402
* pt.c (lookup_template_class_1): Check context returned by
tsubst for error_mark_node.
2012-01-19 Kai Tietz <ktietz@redhat.com>
PR c++/51344

View File

@ -1,6 +1,6 @@
/* Handle parameterized types (templates) for GNU C++.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing.
Rewritten by Jason Merrill (jason@cygnus.com).
@ -7466,6 +7466,9 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context,
context = tsubst (DECL_CONTEXT (gen_tmpl), arglist,
complain, in_decl);
if (context == error_mark_node)
return error_mark_node;
if (!context)
context = global_namespace;

View File

@ -1,3 +1,8 @@
2012-01-20 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51402
* g++.dg/template/crash110.C: New.
2012-01-20 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gcc.misc-tests/gcov-14.c: Skip on alpha*-dec-osf*.

View File

@ -0,0 +1,7 @@
// PR c++/51402
template<void> struct A // { dg-error "not a valid type" }
{
template<int,int> struct B {};
template<int N> struct B<N,N> {};
};