OSDN Git Service

cp:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Jan 2001 16:35:36 +0000 (16:35 +0000)
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 5 Jan 2001 16:35:36 +0000 (16:35 +0000)
* parse.y (template_datadef): Check for error_mark_node.
testsuite:
* g++.old-deja/g++.pt/crash62.C: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38714 138bc75d-0d04-0410-961f-82ee72b054a4

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

index c9ee127..d7a7a3b 100644 (file)
@@ -1,5 +1,9 @@
 2001-01-05  Nathan Sidwell  <nathan@codesourcery.com>
 
+       * parse.y (template_datadef): Check for error_mark_node.
+
+2001-01-05  Nathan Sidwell  <nathan@codesourcery.com>
+
        * cp-tree.def (DEFAULT_ARG): Make `x' class.
 
 2001-01-04  Joseph S. Myers  <jsm28@cam.ac.uk>
index 0970057..c92b791 100644 (file)
@@ -696,8 +696,13 @@ template_datadef:
        | typed_declspecs initdecls ';'
                 { note_list_got_semicolon ($1.t); }
        | structsp ';'
-                { maybe_process_partial_specialization ($1.t);
-                 note_got_semicolon ($1.t); }
+                {
+                 if ($1.t != error_mark_node)
+                    {
+                     maybe_process_partial_specialization ($1.t);
+                     note_got_semicolon ($1.t);
+                   }
+                }
        ;
 
 datadef:
index 59891ec..61a5d2b 100644 (file)
@@ -1,3 +1,7 @@
+2001-01-05  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * g++.old-deja/g++.pt/crash62.C: New test.
+
 2001-01-04  Richard Henderson  <rth@redhat.com>
 
        * gcc.dg/20000926-1.c: Update expected warnings.
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash62.C b/gcc/testsuite/g++.old-deja/g++.pt/crash62.C
new file mode 100644 (file)
index 0000000..faf97af
--- /dev/null
@@ -0,0 +1,8 @@
+// Build don't link:
+
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Jan 2001 <nathan@codesourcery.com>
+
+// Bug 911, ICE on bogus template declaration
+
+template <class T> class A<T>;    // ERROR - not a template