diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c9ee1278a2a6..d7a7a3b14804 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2001-01-05 Nathan Sidwell + + * parse.y (template_datadef): Check for error_mark_node. + 2001-01-05 Nathan Sidwell * cp-tree.def (DEFAULT_ARG): Make `x' class. diff --git a/gcc/cp/parse.y b/gcc/cp/parse.y index 0970057d378b..c92b7916a713 100644 --- a/gcc/cp/parse.y +++ b/gcc/cp/parse.y @@ -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: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 59891ece4ec6..61a5d2b34466 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2001-01-05 Nathan Sidwell + + * g++.old-deja/g++.pt/crash62.C: New test. + 2001-01-04 Richard Henderson * 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 index 000000000000..faf97af1ab8f --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/crash62.C @@ -0,0 +1,8 @@ +// Build don't link: + +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 5 Jan 2001 + +// Bug 911, ICE on bogus template declaration + +template class A; // ERROR - not a template