Handle ERROR_MARK input
authorburley <burley@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 May 1999 19:56:58 +0000 (19:56 +0000)
committerburley <burley@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 9 May 1999 19:56:58 +0000 (19:56 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26848 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/c-typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/990506-0.c [new file with mode: 0644]

index 99b09bc..40d12c7 100644 (file)
@@ -1,3 +1,8 @@
+Sun May  9 22:51:04 1999  Craig Burley  <craig@jcb-sc.com>
+
+       Fix gcc.dg/990506-0.c:
+       * c-typeck.c (require_complete_type): Handle ERROR_MARK input.
+
 Sun May  9 13:19:12 1999  Jeffrey A Law  (law@cygnus.com)
 
        * gcse.c (cprop_insn): Do not try to simplify a simple jump.
index 5133719..854baf8 100644 (file)
@@ -83,6 +83,9 @@ require_complete_type (value)
 {
   tree type = TREE_TYPE (value);
 
+  if (TREE_CODE (value) == ERROR_MARK)
+    return error_mark_node;
+
   /* First, detect a valid value with a complete type.  */
   if (TYPE_SIZE (type) != 0
       && type != void_type_node)
index 534572b..e421d52 100644 (file)
@@ -1,3 +1,7 @@
+1999-05-08  Craig Burley  <craig@jcb-sc.com>
+
+       * gcc.dg/990506-0.c: New test.
+
 1999-05-08  Richard Henderson  <rth@cygnus.com>
 
        * g++.old-deja/g++.benjamin/p12475.C: Use LONG_MAX to find
diff --git a/gcc/testsuite/gcc.dg/990506-0.c b/gcc/testsuite/gcc.dg/990506-0.c
new file mode 100644 (file)
index 0000000..7db7215
--- /dev/null
@@ -0,0 +1,9 @@
+/* Verify that a diagnostic is issued without crashing due to
+   --enable-checking catching a bug in the C front end.  */
+/* { dg-do compile } */
+x()
+{
+  foo (i);
+  /* { dg-error "undeclared" "undeclared-variable message" { target native } { 6 } } */
+  /* { dg-error "function it appears in" "reminder message" { target native } { 6 } } */ 
+}