PR c++/31941
* error.c (resolve_virtual_fun_from_obj_type_ref): Handle
TARGET_VTABLE_USES_DESCRIPTORS targets properly.
* g++.dg/parse/crash37.C: New test.
From-SVN: r127747
+2007-08-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/31941
+ * error.c (resolve_virtual_fun_from_obj_type_ref): Handle
+ TARGET_VTABLE_USES_DESCRIPTORS targets properly.
+
2007-08-22 Jason Merrill <jason@redhat.com>
PR c++/29365
resolve_virtual_fun_from_obj_type_ref (tree ref)
{
tree obj_type = TREE_TYPE (OBJ_TYPE_REF_OBJECT (ref));
- int index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1);
+ HOST_WIDE_INT index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1);
tree fun = BINFO_VIRTUALS (TYPE_BINFO (TREE_TYPE (obj_type)));
- while (index--)
+ while (index)
+ {
fun = TREE_CHAIN (fun);
+ index -= (TARGET_VTABLE_USES_DESCRIPTORS
+ ? TARGET_VTABLE_USES_DESCRIPTORS : 1);
+ }
return BV_FN (fun);
}
+2007-08-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/31941
+ * g++.dg/parse/crash37.C: New test.
+
2007-08-23 Uros Bizjak <ubizjak@gmail.com>
PR target/17390
--- /dev/null
+// PR c++/31941
+// { dg-do compile }
+
+struct S
+{
+ S() throw () { }
+ virtual ~S () throw ();
+ virtual const char* what () const throw ();
+};
+
+const char *
+foo (S &e)
+{
+ return e.what ().c_str (); // { dg-error "c_str.*S::what.*which is of non-class type" }
+}