Commit b37bf5bd by Nathan Sidwell Committed by Nathan Sidwell

parse.y (template_parm_header, [...]): New reductions.

cp:
	* parse.y (template_parm_header, template_spec_header): New
	reductions. Split out from ...
	(template_header): ... here. Use them.
	(template_template_parm): Use template_parm_header.
	* semantics.c (finish_template_template_parm): Add assert.
testsuite:
	* g++.old-deja/g++.pt/crash63.C: New test.

From-SVN: r38900
parent 0ab409ed
2001-01-11 Nathan Sidwell <nathan@codesourcery.com>
* parse.y (template_parm_header, template_spec_header): New
reductions. Split out from ...
(template_header): ... here. Use them.
(template_template_parm): Use template_parm_header.
* semantics.c (finish_template_template_parm): Add assert.
2001-01-10 Mark Mitchell <mark@codesourcery.com>
* mangle.c (write_builtin_type): Fix thinko.
......
......@@ -395,7 +395,8 @@ cp_parse_init ()
%type <ttype> maybe_parmlist
%type <ttype> member_init
%type <ftype> member_init_list
%type <ttype> template_header template_parm_list template_parm
%type <ttype> template_parm_header template_spec_header template_header
%type <ttype> template_parm_list template_parm
%type <ttype> template_type_parm template_template_parm
%type <code> template_close_bracket
%type <ttype> apparent_template_type
......@@ -599,16 +600,24 @@ extern_lang_string:
pop_lang_context (); push_lang_context ($2); }
;
template_header:
template_parm_header:
TEMPLATE '<'
{ begin_template_parm_list (); }
template_parm_list '>'
{ $$ = end_template_parm_list ($4); }
| TEMPLATE '<' '>'
;
template_spec_header:
TEMPLATE '<' '>'
{ begin_specialization();
$$ = NULL_TREE; }
;
template_header:
template_parm_header
| template_spec_header
;
template_parm_list:
template_parm
{ $$ = process_template_parm (NULL_TREE, $1); }
......@@ -630,7 +639,7 @@ template_type_parm:
;
template_template_parm:
template_header aggr maybe_identifier
template_parm_header aggr maybe_identifier
{ $$ = finish_template_template_parm ($2, $3); }
;
......
......@@ -1689,6 +1689,8 @@ finish_template_template_parm (aggr, identifier)
DECL_ARTIFICIAL (decl) = 1;
end_template_decl ();
my_friendly_assert (DECL_TEMPLATE_PARMS (tmpl), 20010110);
return finish_template_type_parm (aggr, tmpl);
}
......
2001-01-11 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.pt/crash63.C: New test.
2001-01-11 Neil Booth <neil@daikokuya.demon.co.uk>
* gcc.dg/cpp/if-2.c: Add wide char test without sign extension.
......@@ -8,15 +12,15 @@
2001-01-10 Nathan Sidwell <nathan@codesourcery.com>
* g++.old_deja/g++.pt/error3.C: New test.
* g++.old-deja/g++.pt/error3.C: New test.
2001-01-10 Nathan Sidwell <nathan@codesourcery.com>
* g++.old_deja/g++.other/crash39.C: New test.
* g++.old-deja/g++.other/crash39.C: New test.
2001-01-10 Nathan Sidwell <nathan@codesourcery.com>
* g++.old_deja/g++.other/vbase4.C: New test.
* g++.old-deja/g++.other/vbase4.C: New test.
2001-01-08 Jonathan Larmour <jlarmour@redhat.com>
......
// Build don't link:
// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 10 Jan 2001 <nathan@codesourcery.com>
// Bug 1585. We ICEd on a template template parm with no parms.
template<template<class> class C> class B;
template<template<> class C> class D; // ERROR - parse error
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