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

Dmitry Polukhin via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 6 10:58:51 PDT 2016


DmitryPolukhin added a comment.

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. Also user may want to explicitly control what should be exported from his library and may decide to remove some functions from exported interface.


http://reviews.llvm.org/D22034





More information about the cfe-commits mailing list