diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/crash24.C | 8 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/crash37.C | 18 |
5 files changed, 32 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ec50f9e..b3a5dfd 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-11-24 Nathan Sidwell <nathan@codesourcery.com> + + * semantics.c (finish_id_expr): If type is error_mark, return + error_mark. + 2000-11-23 Nathan Sidwell <nathan@codesourcery.com> * pt.c (lookup_template_class): Simplify loop exit constructs. diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index b372fdd..8d22ce2 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1534,6 +1534,8 @@ finish_id_expr (expr) if (TREE_CODE (expr) == IDENTIFIER_NODE) expr = do_identifier (expr, 1, NULL_TREE); + if (TREE_TYPE (expr) == error_mark_node) + expr = error_mark_node; return expr; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b3220ff..f4be566 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2000-11-24 Nathan Sidwell <nathan@codesourcery.com> + + * g++.other/crash24.C: Adjust and remove XFAIL. + * g++.other/crash37.C: New test. + 2000-11-23 Nathan Sidwell <nathan@codesourcery.com> * g++.old-deja/g++.pt/instantiate9.C: New test. diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash24.C b/gcc/testsuite/g++.old-deja/g++.other/crash24.C index 1efbd77..b3561af 100644 --- a/gcc/testsuite/g++.old-deja/g++.other/crash24.C +++ b/gcc/testsuite/g++.old-deja/g++.other/crash24.C @@ -1,10 +1,6 @@ // Build don't link: // Origin: Jakub Jelinek <jakub@redhat.com> -// crash test - XFAIL *-*-* - -#include <iostream> - class foo { public: class __iterator; @@ -16,6 +12,6 @@ class foo { static void iteratorTest(const foo &x) { foo::const_iterator i = x.begin(); // ERROR - - for (; i; ++i) // ERROR - - cout << *i; + for (; i; ++i) + *i; } diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash37.C b/gcc/testsuite/g++.old-deja/g++.other/crash37.C new file mode 100644 index 0000000..3b734dd --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/crash37.C @@ -0,0 +1,18 @@ +// Build don't link: + +// Copyright (C) 2000 Free Software Foundation, Inc. +// Contributed by Nathan Sidwell 23 Nov 2000 <nathan@codesourcery.com> + +// bug 706. We iced when meeting a decl with type error-mark-node + +class bifstream; + + +int main() +{ + bifstream bifs; // ERROR - incomplete type + if (!bifs) + { + } + return 0; +} |