re PR objc++/28434 (ICE with invalid protocol)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Wed, 19 Jul 2006 19:56:29 +0000 (19:56 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Wed, 19 Jul 2006 19:56:29 +0000 (19:56 +0000)
PR obj-c++/28434
* objc-act.c (lookup_and_install_protocols): Skip error_mark_nodes.

* obj-c++.dg/proto-error-1.mm: New test.

From-SVN: r115599

gcc/objc/ChangeLog
gcc/objc/objc-act.c
gcc/testsuite/ChangeLog
gcc/testsuite/obj-c++.dg/proto-error-1.mm [new file with mode: 0644]

index ee36565ea402519442cbca6cbaf1129d1dce61e3..63c32e3d6e9f17c8f33f712c7b1c6244276421d8 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-19  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR obj-c++/28434
+       * objc-act.c (lookup_and_install_protocols): Skip error_mark_nodes.
+
 2006-06-06  Mike Stump  <mrs@apple.com>
 
        * objc-act.c: Remove prototype for objc_build_volatilized_type.
index 39d12fc00c66b470a33122b78aa4039656b66b5e..88b9386a38667c8dc54236cf5bbc8c038660ccdd 100644 (file)
@@ -1433,12 +1433,12 @@ lookup_and_install_protocols (tree protocols)
       tree ident = TREE_VALUE (proto);
       tree p = lookup_protocol (ident);
 
-      if (!p)
-       error ("cannot find protocol declaration for %qs",
-              IDENTIFIER_POINTER (ident));
-      else
+      if (p)
        return_value = chainon (return_value,
                                build_tree_list (NULL_TREE, p));
+      else if (ident != error_mark_node)
+       error ("cannot find protocol declaration for %qs",
+              IDENTIFIER_POINTER (ident));
     }
 
   return return_value;
index 7fef2708796af20340a6f1952e1faaa7838aecc8..e335856235f118f6710852be0cbebb976f0320a4 100644 (file)
@@ -1,3 +1,8 @@
+2006-07-19  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR obj-c++/28434
+       * obj-c++.dg/proto-error-1.mm: New test.
+
 2006-07-18  Mark Mitchell  <mark@codesourcery.com>
 
        PR c++/28337
diff --git a/gcc/testsuite/obj-c++.dg/proto-error-1.mm b/gcc/testsuite/obj-c++.dg/proto-error-1.mm
new file mode 100644 (file)
index 0000000..888db47
--- /dev/null
@@ -0,0 +1,4 @@
+// PR obj-c++/28434
+// { dg-do compile }
+
+Class<> c;  // { dg-error "identifier" }