mangle.c (hash_type): val is the TREE_LIST itself, not a pointer to it.
authorJakub Jelinek <jakub@redhat.com>
Mon, 23 Jun 2003 14:52:00 +0000 (16:52 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 23 Jun 2003 14:52:00 +0000 (16:52 +0200)
* mangle.c (hash_type): val is the TREE_LIST itself, not a pointer
to it.

* g++.dg/opt/operator1.C: New test.

From-SVN: r68364

gcc/cp/ChangeLog
gcc/cp/mangle.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/operator1.C [new file with mode: 0644]

index 7809040519e2af382fa81b3c68408d37072d7bc6..77d85a68d75cb54e361a380512bee313b7a74daf 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-23  Jakub Jelinek  <jakub@redhat.com>
+
+       * mangle.c (hash_type): val is the TREE_LIST itself, not a pointer
+       to it.
+
 2003-06-21  Gabriel Dos Reis <gdr@integrable-solutions.net>
 
        PR c++/10784
index 2040ae996d6a6fb27f91f892fae4c06df5333da6..e4c75b473c6b1c1f590098752071f098a55de65f 100644 (file)
@@ -2597,7 +2597,7 @@ static GTY ((param_is (union tree_node))) htab_t conv_type_names;
 static hashval_t
 hash_type (const void *val)
 {
-  return htab_hash_pointer (TREE_PURPOSE (*((tree *) val)));
+  return htab_hash_pointer (TREE_PURPOSE ((tree) val));
 }
 
 /* Compare VAL1 (a node in the table) with VAL2 (a TYPE).  */
index 099c83060e2bd2e578c0a5007dc260087a11f9bf..985998ac5ff61aafdb0aafba0fb6cff4c385950a 100644 (file)
@@ -1,3 +1,7 @@
+2003-06-23  Jakub Jelinek  <jakub@redhat.com>
+
+       * g++.dg/opt/operator1.C: New test.
+
 2003-06-22  Roger Sayle  <roger@eyesopen.com>
 
        * gcc.c-torture/execute/string-opt-16.c: New test case.
diff --git a/gcc/testsuite/g++.dg/opt/operator1.C b/gcc/testsuite/g++.dg/opt/operator1.C
new file mode 100644 (file)
index 0000000..9f286b9
--- /dev/null
@@ -0,0 +1,10 @@
+// Tests whether g++ can handle large number of operators
+// { dg-do compile }
+
+#define OP0(n) struct I##n { int i; }; operator I##n ();
+#define OP1(n) OP0(n)
+#define OP2(n) OP1(n##0) OP1(n##1) OP1(n##2) OP1(n##3) OP1(n##4)
+#define OP3(n) OP2(n##0) OP2(n##1) OP2(n##2) OP2(n##3) OP2(n##4)
+struct S {
+  OP3(0) OP3(1) OP3(2) OP3(3) OP3(4) OP3(5)
+};