From 220bce48e55cf7c052b513e39b4da0df8346ed18 Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Fri, 5 Jan 2001 16:35:36 +0000 Subject: [PATCH] parse.y (template_datadef): Check for error_mark_node. 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 | 4 ++++ gcc/cp/parse.y | 9 +++++++-- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/g++.old-deja/g++.pt/crash62.C | 8 ++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/crash62.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c9ee1278a2a..d7a7a3b1480 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 0970057d378..c92b7916a71 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 59891ece4ec..61a5d2b3446 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 00000000000..faf97af1ab8 --- /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 -- 2.30.2