I think it's handling this corner case:
  struct Incomplete;
  struct A { int a; virtual A *bar(); };
  struct B { int b; virtual B *foo(Incomplete); };
  struct C : A, B { int c; virtual C *foo(Incomplete); };
  C c;

MSVC gives this error:
  t.cpp(5) : error C2664: 'C *C::foo(Incomplete)' : cannot convert argument 1 
from 'Incomplete' to 'Incomplete'
        Source or target has incomplete type
        This diagnostic occurred in the compiler generated function 'B 
*C::foo(Incomplete)'

Clang on the other hand relies on the TU defining the virtual function to emit 
code for the thunk.  Therefore I think the correct linkage is weak_odr.  This 
should also be applicable to the Itanium C++ ABI.

http://reviews.llvm.org/D3992



_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to