]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/27278 (ICE with invalid operator declaration)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Sun, 30 Apr 2006 10:40:18 +0000 (10:40 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Sun, 30 Apr 2006 10:40:18 +0000 (10:40 +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: r113391

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

index cfc4cc19e863a7ad501e079a18ca4c25174ee31e..11fc298cc1e16436036d94d27dbfd471073ed8f6 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 5adaf966e71a6ec167bc7854bd67d1294289bfb4..589d918e2a056a93b2d1278837db91adfd4a74f7 100644 (file)
@@ -8747,6 +8747,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 af1b155246273d680a7a7dafb448e7b7fd26a6d4..6f03322197bcae39a3b9ee989f01811fc5958061 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++/27279
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" }