]> granicus.if.org Git - clang/commit
Don't emit strong vtable definitions for imported classes with key functions (PR21355)
authorHans Wennborg <hans@hanshq.net>
Thu, 23 Oct 2014 22:40:46 +0000 (22:40 +0000)
committerHans Wennborg <hans@hanshq.net>
Thu, 23 Oct 2014 22:40:46 +0000 (22:40 +0000)
commit2ca2abc801226101e575a9ee911d3b5fb2e97c41
treec519e483ef36e19e3a37f54de2aaace50f9e850a
parentd881becaada015e075d658e63dee39262043898c
Don't emit strong vtable definitions for imported classes with key functions (PR21355)

Clang would previously assert on the following code when targeting MinGW:

  struct __declspec(dllimport) S {
      virtual ~S();
  };
  S::~S() {}

Because ~S is a key function and the class is dllimport, we would try to emit a
strong definition of the vtable, with dllimport - which is a conflict. We
should not emit strong vtable definitions for imported classes.

Differential Revision: http://reviews.llvm.org/D5944

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220532 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGVTables.cpp
test/CodeGenCXX/dllimport.cpp