parse.y (template_datadef): Check for error_mark_node.
authorNathan Sidwell <nathan@codesourcery.com>
Fri, 5 Jan 2001 16:35:36 +0000 (16:35 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Fri, 5 Jan 2001 16:35:36 +0000 (16:35 +0000)
cp:
* parse.y (template_datadef): Check for error_mark_node.
testsuite:
* g++.old-deja/g++.pt/crash62.C: New test.

From-SVN: r38714

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 c9ee1278a2a6d857ad876686fb3dd310e0f0b660..d7a7a3b1480446e8c17a12bff3d9d09832b0a520 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 0970057d378b17ff9e98b6e75b43421d2cf6e951..c92b7916a713e07b509ca4925a816b5dd44f086d 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 59891ece4ec62ba075dd437e4098fdec84da7c03..61a5d2b34466e917c5f43bc548f737f7c405708e 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