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

            Bug ID: 16759
           Summary: [-cxx-abi microsoft] Should issue a compiler error for
                    class hierarchies we can't lay out vftables for
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Example:
------------------------
struct C0 { int x; };
struct C1 : C0 { virtual void f(); int y; };
// Converting C0* to C1* is non-trivial

struct A {
  virtual C0 *foo();  // in vftable slot #0.
  virtual C0 *bar();  // in vftable slot #1.
};

struct B : virtual A {
  virtual C1 *foo(); // appended to the A subobject's vftable in slot #2.
};

struct C : virtual A {
  virtual C1 *bar(); // appended to the A subobject's vftable in slot #2.
};

struct D : B, C {};
// It's ambiguous what's in the slot #2 of the A subobject's vftable.
------------------------

CL issues this compiler error:
"vftable.cpp(17) : error C2250: 'D' : ambiguous inheritance of 'C1
*A::foo(void)'",
Clang should do something similar. Currently, it just lays out the vftable,
putting foo() at the end, thus such code may misbehave at run time.

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

Reply via email to