semantics.c (begin_class_definition): Check we're not inside a template parm list.

cp:
	* semantics.c (begin_class_definition): Check we're not inside a
	template parm list.
testsuite:
	* g++.old-deja/g++.pt/crash65.C: New test.

From-SVN: r39113
This commit is contained in:
Nathan Sidwell 2001-01-18 09:35:59 +00:00 committed by Nathan Sidwell
parent 7f805b8ffc
commit 522d6614c5
4 changed files with 26 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2001-01-18 Nathan Sidwell <nathan@codesourcery.com>
* semantics.c (begin_class_definition): Check we're not inside a
template parm list.
2001-01-18 Nathan Sidwell <nathan@codesourcery.com>
* tree.c (walk_tree, TREE_LIST): Don't walk the TREE_PURPOSE of

View File

@ -1720,6 +1720,11 @@ tree
begin_class_definition (t)
tree t;
{
if (processing_template_parmlist)
{
cp_error ("definition of `%#T' inside template parameter list", t);
return error_mark_node;
}
if (t == error_mark_node
|| ! IS_AGGR_TYPE (t))
{

View File

@ -1,3 +1,7 @@
2001-01-18 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.pt/crash65.C: New test.
2001-01-18 Neil Booth <neil@daikokuya.demon.co.uk>
* gcc.dg/cpp/assembl2.S: New test case.

View File

@ -0,0 +1,12 @@
// Build don't link:
// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 11 Jan 2001 <nathan@codesourcery.com>
// Bug 1506. We ICE'd on a struct definition inside a template parms.
// This is still not completely fixed, but now issues a diagnostic
// crash test - XFAIL *-*-*
template<class T =
struct W {}; // ERROR - inside template parms