Commit c6f3d2f4 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/31941 ("confused by earlier errors" message without earlier error message)

	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
parent ddcd0f6f
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
......
......@@ -1438,10 +1438,14 @@ static tree
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
// 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" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment