]> gcc.gnu.org Git - gcc.git/commitdiff
parse.y (template_parm_header, [...]): New reductions.
authorNathan Sidwell <nathan@codesourcery.com>
Thu, 11 Jan 2001 11:29:06 +0000 (11:29 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Thu, 11 Jan 2001 11:29:06 +0000 (11:29 +0000)
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

gcc/cp/ChangeLog
gcc/cp/parse.y
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.pt/crash63.C [new file with mode: 0644]

index 8a933059fc50c287c453dfa3170860de82505538..31d2d1229a17a94dd0cea8385956509f3b17fed3 100644 (file)
@@ -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.
index c92b7916a713e07b509ca4925a816b5dd44f086d..f74fae4b1adabdfe42191d24b61bf7708ccf7767 100644 (file)
@@ -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); }
        ;
 
index cf882792ad13dcb8d141f50d6e8eb12cbda4f978..10e67c644634cb5067f8cdb44aa367bd3baf7601 100644 (file)
@@ -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);
 }
 
index e73fd5c21838be2568d785b63c8543832fdb02f6..a87cf8850d7f6d3844ce80e452b35f33643179ce 100644 (file)
@@ -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.
        
 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 (file)
index 0000000..f88af72
--- /dev/null
@@ -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
This page took 0.108113 seconds and 5 git commands to generate.