aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2000-11-07 13:58:21 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2000-11-07 13:58:21 +0000
commitd48ebde10d34cfc027aff6f1e1bb6f7a52835d6d (patch)
tree8454d98f3a77718378e6d41394bdf2e33e09f82a
parent665d66d647a24dd78c881d9473b06d861468f06f (diff)
downloadgcc-d48ebde10d34cfc027aff6f1e1bb6f7a52835d6d.zip
gcc-d48ebde10d34cfc027aff6f1e1bb6f7a52835d6d.tar.gz
gcc-d48ebde10d34cfc027aff6f1e1bb6f7a52835d6d.tar.bz2
decl.c (build_ptrmemfunc_type): Allow error_mark_node.
cp: * decl.c (build_ptrmemfunc_type): Allow error_mark_node. testsuite: * g++.old-deja/g++.pt/crash60.C: New test. From-SVN: r37289
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/decl.c3
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/crash60.C18
4 files changed, 29 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index b79e310..62edaf5 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2000-11-07 Nathan Sidwell <nathan@codesourcery.com>
+
+ * decl.c (build_ptrmemfunc_type): Allow error_mark_node.
+
2000-11-05 Joseph S. Myers <jsm28@cam.ac.uk>
* Make-lang.in (c++.distdir): Remove.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index d4d9bba..f4d170a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -9215,6 +9215,9 @@ build_ptrmemfunc_type (type)
tree u;
tree unqualified_variant = NULL_TREE;
+ if (type == error_mark_node)
+ return type;
+
/* If a canonical type already exists for this type, use it. We use
this method instead of type_hash_canon, because it only does a
simple equality check on the list of field members. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 9940b98..61bc1c1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2000-11-07 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.old-deja/g++.pt/crash60.C: New test.
+
2000-11-06 Jakub Jelinek <jakub@redhat.com>
* g++.old-deja/g++.other/crash24.C: New test.
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash60.C b/gcc/testsuite/g++.old-deja/g++.pt/crash60.C
new file mode 100644
index 0000000..3d7eb1c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.pt/crash60.C
@@ -0,0 +1,18 @@
+// Build don't link:
+// Copyright (C) 2000 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 7 Nov 2000 <nathan@codesourcery.com>
+
+// We ICE'd rather than fail to instantiate.
+
+template< typename SID, class SDR >
+void k( SID sid, SDR* p,
+ void (SDR::*)
+ ( typename SID::T ) );
+
+struct E { };
+struct S { void f( int ); };
+
+void f()
+{
+ k( E(), (S*)0, &S::f ); // ERROR - no match
+}