PR c++/47873
* class.c (update_vtable_entry_for_fn): Check BINFO_LOST_PRIMARY_P
after checking for a non-thunk.
From-SVN: r170576
+2011-02-28 Jason Merrill <jason@redhat.com>
+
+ PR c++/47873
+ * class.c (update_vtable_entry_for_fn): Check BINFO_LOST_PRIMARY_P
+ after checking for a non-thunk.
+
2011-02-26 Jason Merrill <jason@redhat.com>
PR c++/47904
{
tree main_binfo = TYPE_BINFO (BINFO_TYPE (b));
tree bv = chain_index (ix, BINFO_VIRTUALS (main_binfo));
- if (BINFO_LOST_PRIMARY_P (b))
- lost = true;
if (!DECL_THUNK_P (TREE_VALUE (bv)))
break;
+ if (BINFO_LOST_PRIMARY_P (b))
+ lost = true;
}
first_defn = b;
}
+2011-02-28 Jason Merrill <jason@redhat.com>
+
+ * g++.dg/inherit/covariant18.C: New.
+
2011-02-28 Jakub Jelinek <jakub@redhat.com>
PR middle-end/47893
--- /dev/null
+// PR c++/47873
+// { dg-do run }
+
+struct Base
+{
+ virtual ~Base(){}
+
+ virtual Base& This() { return *this; }
+};
+
+
+struct Ent : virtual Base
+{
+ void *m_Body;
+
+ Ent& This() { return *this; }
+
+ virtual Ent& body()
+ {
+ return This();
+ }
+
+};
+
+
+struct Msg : virtual Ent
+{
+ Msg()
+ {
+ body();
+ }
+
+ Msg& This() { return *this; }
+};
+
+int main()
+{
+ Msg m;
+
+ return 0;
+}