This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

I.C.E. 390


David, Matthias,

Thanks for your test cases. A patch to fix both is included below.

Martin

1998-05-31  Martin von Löwis  <loewis@informatik.hu-berlin.de>

	* decl2.c (arg_assoc_type): Process unknown_type_node and OFFSET_TYPE.

Index: decl2.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl2.c,v
retrieving revision 1.79
diff -c -p -r1.79 decl2.c
*************** arg_assoc_type (k, type)
*** 4170,4175 ****
--- 4162,4172 ----
      case UNION_TYPE:
      case ENUMERAL_TYPE:
        return arg_assoc_namespace (k, decl_namespace (TYPE_MAIN_DECL (type)));
+     case OFFSET_TYPE:
+       /* Pointer to member: associate class type and value type. */
+       if (arg_assoc_type (k, TYPE_OFFSET_BASETYPE (type)))
+ 	return 1;
+       return arg_assoc_type (k, TREE_TYPE (type));
      case METHOD_TYPE:
        /* Associate the class of the method. */
        if (arg_assoc_type (k, TYPE_METHOD_BASETYPE (type)))
*************** arg_assoc_type (k, type)
*** 4181,4186 ****
--- 4178,4187 ----
  	return 1;
        /* Associate the return type. */
        return arg_assoc_type (k, TREE_TYPE (type));
+     case LANG_TYPE:
+       if (type == unknown_type_node)
+ 	return 0;
+       /* else fall through */
      default:
        my_friendly_abort (390);
      }
--- /dev/null	Mon Jul 18 01:46:18 1994
+++ g++.ns/koenig2.C	Sun May 31 19:56:36 1998
@@ -0,0 +1,9 @@
+//Build don't link:
+//Check association of {error} for Koenig lookup
+class QString { };
+int foo()
+{
+	QString bar;
+	if (bar == __null ) {
+    }
+}
--- /dev/null	Mon Jul 18 01:46:18 1994
+++ g++.ns/koenig3.C	Sun May 31 19:58:55 1998
@@ -0,0 +1,21 @@
+//Check association of member pointer in overload resolution.
+struct A {
+	int m_val;
+	friend int operator ->* (A & other, int A::*pm)
+		{ return 31; }
+};
+
+int A::*pi = & A::m_val;
+
+int
+main(void)
+{
+	A c;
+	c.m_val = 42;
+	int j = c ->* pi;
+
+	if (j == 31)
+		return 0;
+	else
+		return 1;
+}	


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]