* call.c (maybe_handle_ref_bind): Copy ICS_USER_FLAG and
ICS_BAD_FLAG.
* g++.old-deja/g++.other/overload14.C: New test.
From-SVN: r41448
+2001-04-20 Jakub Jelinek <jakub@redhat.com>
+
+ * call.c (maybe_handle_ref_bind): Copy ICS_USER_FLAG and
+ ICS_BAD_FLAG.
+
2001-04-20 Jakub Jelinek <jakub@redhat.com>
* search.c (lookup_field_r): If looking for type and non-TYPE_DECL
{
if (TREE_CODE (*ics) == REF_BIND)
{
+ tree old_ics = *ics;
*target_type = TREE_TYPE (TREE_TYPE (*ics));
*ics = TREE_OPERAND (*ics, 0);
+ ICS_USER_FLAG (*ics) = ICS_USER_FLAG (old_ics);
+ ICS_BAD_FLAG (*ics) = ICS_BAD_FLAG (old_ics);
return 1;
}
-
+
return 0;
}
+2001-04-20 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.old-deja/g++.other/overload14.C: New test.
+
2001-04-20 Jakub Jelinek <jakub@redhat.com>
* g++.old-deja/g++.other/lookup23.C: New test.
--- /dev/null
+extern "C" void abort();
+
+struct A {
+ typedef double (&B);
+ typedef const double (&C);
+
+ A() { }
+
+ operator C () const;
+ operator B ();
+};
+
+static const double d = 2.0;
+static double e = 3.0;
+
+A::operator A::C () const
+{
+ abort ();
+ return d;
+}
+
+A::operator A::B ()
+{
+ return e;
+}
+
+int main ()
+{
+ (A::C) A (); // WARNING -
+ return 0;
+}