]> granicus.if.org Git - clang/commit
[COFF] Don't try to emit weak aliases on COFF
authorReid Kleckner <rnk@google.com>
Tue, 10 Nov 2015 22:23:58 +0000 (22:23 +0000)
committerReid Kleckner <rnk@google.com>
Tue, 10 Nov 2015 22:23:58 +0000 (22:23 +0000)
commitf79804db7277ddc55cbdc2d38304d307e87fb7e3
tree5dbabd1189ce7f4c3d8f827028c6bef461194d52
parentb964ad11c0eeecf0f82cdf04a688ce76c7b1db69
[COFF] Don't try to emit weak aliases on COFF

This comes up when a derived class destructor is equivalent to a base
class destructor defined in the same TU, and we try to alias them.

A COFF weak alias cannot satisfy a normal undefined symbol reference
from another TU. The other TU must also mark the referenced symbol as
weak, and we can't rely on that.

Clang already has a special case here for dllexport, but we failed to
realize that the problem also applies to other non-discardable symbols
such as those from explicit template instantiations.

Fixes PR25477.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@252659 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGCXX.cpp
test/CodeGenCXX/microsoft-abi-structors-alias.cpp