Commit b968b192 by Paolo Carlini Committed by Paolo Carlini

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
parent bad2e812
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
......
/* 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;
......
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*.
......
// 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> {};
};
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