@@ -2250,10 +2250,10 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals,
{
tree main_binfo = TYPE_BINFO (BINFO_TYPE (b));
tree bv = chain_index (ix, BINFO_VIRTUALS (main_binfo));
+ if (!DECL_THUNK_P (TREE_VALUE (bv)))
+ break;
if (BINFO_LOST_PRIMARY_P (b))
lost = true;
- if (!DECL_THUNK_P (TREE_VALUE (bv)))
- break;
}
first_defn = b;
}
new file mode 100644
@@ -0,0 +1,41 @@
+// 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;
+}