diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2001-01-11 11:29:06 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2001-01-11 11:29:06 +0000 |
commit | b37bf5bdb3fb6f648e103c35df5a05165277956d (patch) | |
tree | 11b6da7db1cd5be48000f077ba320d400ebfe72a /gcc | |
parent | 0ab409ed42980a740a408a48ec54d715358933d9 (diff) | |
download | gcc-b37bf5bdb3fb6f648e103c35df5a05165277956d.zip gcc-b37bf5bdb3fb6f648e103c35df5a05165277956d.tar.gz gcc-b37bf5bdb3fb6f648e103c35df5a05165277956d.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/parse.y | 17 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/crash63.C | 9 |
5 files changed, 39 insertions, 7 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 8a93305..31d2d12 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +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. diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y index c92b791..f74fae4 100644 --- a/gcc/cp/parse.y +++ b/gcc/cp/parse.y @@ -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); } ; diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index cf88279..10e67c6 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e73fd5c..a87cf88 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +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> diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash63.C b/gcc/testsuite/g++.old-deja/g++.pt/crash63.C new file mode 100644 index 0000000..f88af72 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash63.C @@ -0,0 +1,9 @@ +// 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 |