http://llvm.org/bugs/show_bug.cgi?id=20444

            Bug ID: 20444
           Summary: VFTable larger than needed for multiple inheritance
                    hierarchy
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangb...@nondot.org
          Reporter: david.majne...@gmail.com
                CC: llvmbugs@cs.uiuc.edu
    Classification: Unclassified

struct A {
  virtual A *f() { return 0; }
};
struct B {
  virtual B *f() { return 0; }
};
struct C : A, B {
  virtual C *f() { return 0; }
};
A a;
B b;
C c;
B *get_c() { return &c; }
int main() {
  get_c()->f();
}

We generate the following:
"??_7C@@6BA@@@":
        .long   "?f@C@@UAEPAU1@XZ"
        .long   "?f@C@@UAEPAU1@XZ"

Note that the VFTable has the same entry twice in it.  This can be very
problematic if we have RTTI because the largest VFTable might not get picked.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
LLVMbugs@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to