OSDN Git Service

cp:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Nov 2000 09:56:27 +0000 (09:56 +0000)
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Nov 2000 09:56:27 +0000 (09:56 +0000)
* semantics.c (finish_id_expr): If type is error_mark, return
error_mark.
testsuite:
* g++.other/crash24.C: Adjust and remove XFAIL.
* g++.other/crash37.C: New test.

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

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.other/crash24.C
gcc/testsuite/g++.old-deja/g++.other/crash37.C [new file with mode: 0644]

index ec50f9e..b3a5dfd 100644 (file)
@@ -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.
index b372fdd..8d22ce2 100644 (file)
@@ -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;
 }
 
index b3220ff..f4be566 100644 (file)
@@ -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.
index 1efbd77..b3561af 100644 (file)
@@ -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 (file)
index 0000000..3b734dd
--- /dev/null
@@ -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;
+}