[PATCH] D22034: [MSVC][DLL] use local vftable mangling only exported classes with virtual destructor

David Majnemer via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 6 11:07:38 PDT 2016


majnemer added a comment.

In http://reviews.llvm.org/D22034#475540, @DmitryPolukhin wrote:

> In http://reviews.llvm.org/D22034#475331, @majnemer wrote:
>
> > Wait, can you give an example of MSVC exporting a vftable but not all the virtual methods (other than the deleting destructor)?  I don't believe I've ever come across an example of this.
>
>
> It is possible in code like this:
>  class B {
>
>   virtual void foo();
>   
>
> public:
>
>   virtual void bar();
>
> };
>
> class __declspec(dllexport) D : public B {
> public:
>
>   virtual void bar();
>
> };
>
> void B::foo() {}
>  void B::bar() {}
>  void D::bar() {}
>
> Here is B::foo is not exported but required to build vftable for D.


What happens if D also had a virtual destructor?


http://reviews.llvm.org/D22034





More information about the cfe-commits mailing list