re PR c++/27278 (ICE with invalid operator declaration)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Sun, 30 Apr 2006 10:34:05 +0000 (10:34 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Sun, 30 Apr 2006 10:34:05 +0000 (10:34 +0000)
PR c++/27278
* decl.c (grok_op_properties): Skip operators with invalid args
when checking for class-type or enum-type args.

* g++.dg/parse/operator7.C: New test.

From-SVN: r113389

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/parse/operator7.C [new file with mode: 0644]

index c93e39f56915a12ffb1968cee1af3dbdbc5b257d..57c80275bd6c8fe58a2206890dea26b267a5d9a0 100644 (file)
@@ -1,3 +1,9 @@
+2006-04-30  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/27278
+       * decl.c (grok_op_properties): Skip operators with invalid args
+       when checking for class-type or enum-type args.
+
 2006-04-29  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/27279
index 1617a47bbfccfaa5d3f82100cf0e44073e494bf2..e59bd68af8f8dddbdb96b7163c1999a54e5938bc 100644 (file)
@@ -9086,6 +9086,9 @@ grok_op_properties (tree decl, bool complain)
              for (p = argtypes; p && p != void_list_node; p = TREE_CHAIN (p))
                {
                  tree arg = non_reference (TREE_VALUE (p));
+                 if (arg == error_mark_node)
+                   return;
+
                  /* IS_AGGR_TYPE, rather than CLASS_TYPE_P, is used
                     because these checks are performed even on
                     template functions.  */
index 6d9172c19fbced6f043c1dfe6c0fb159e8577009..b82e646e90de2e932121c099233fdcc26e1ba120 100644 (file)
@@ -1,3 +1,8 @@
+2006-04-30  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/27278
+       * g++.dg/parse/operator7.C: New test.
+
 2006-04-29  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/11471
diff --git a/gcc/testsuite/g++.dg/parse/operator7.C b/gcc/testsuite/g++.dg/parse/operator7.C
new file mode 100644 (file)
index 0000000..e3464f0
--- /dev/null
@@ -0,0 +1,4 @@
+// PR c++/27278
+// { dg-do compile }
+
+int operator+(void,void);  // { dg-error "incomplete type|invalid use" }