re PR c++/27447 (ICE on invalid ptr-to-member-function)
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Mon, 8 May 2006 00:26:08 +0000 (00:26 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Mon, 8 May 2006 00:26:08 +0000 (00:26 +0000)
PR c++/27447
* decl2.c (build_memfn_type): Skip invalid functions and class types.

* g++.dg/other/ptrmem7.C: New test.

From-SVN: r113615

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/ptrmem7.C [new file with mode: 0644]

index 5035ded..a357204 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-08  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/27447
+       * decl2.c (build_memfn_type): Skip invalid functions and class types.
+
 2006-05-06  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR c++/27427
index ac85b44..f75c4ab 100644 (file)
@@ -114,6 +114,9 @@ build_memfn_type (tree fntype, tree ctype, cp_cv_quals quals)
   tree raises;
   int type_quals;
 
+  if (fntype == error_mark_node || ctype == error_mark_node)
+    return error_mark_node;
+
   type_quals = quals & ~TYPE_QUAL_RESTRICT;
   ctype = cp_build_qualified_type (ctype, type_quals);
   fntype = build_method_type_directly (ctype, TREE_TYPE (fntype),
index f15d7fc..0403b74 100644 (file)
@@ -1,3 +1,8 @@
+2006-05-08  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
+
+       PR c++/27447
+       * g++.dg/other/ptrmem7.C: New test.
+
 2006-05-07  Volker Reichelt  <reichelt@igpm.rwth-aachen.de>
 
        PR target/27421
diff --git a/gcc/testsuite/g++.dg/other/ptrmem7.C b/gcc/testsuite/g++.dg/other/ptrmem7.C
new file mode 100644 (file)
index 0000000..e7722b8
--- /dev/null
@@ -0,0 +1,4 @@
+// PR c++/27447
+// { dg-do compile }
+
+void (A::* p)();  // { dg-error "declared|token" }