llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[ Windows] [C++20] [Modules] [ABI] Linker errors relating to vftable with C++20 modules

Open kamrann opened this issue 7 months ago • 5 comments

The following simple repro will generate multiple definition linker errors on Windows (regardless of link.exe or lld-link.exe, so appears the issue is with clang emitting symbols for every TU importing the module in question).

// mod.mxx
export module mod;
export struct poly
{
  virtual ~poly() = default;
};
// a.cxx
import mod;
poly p1;
// b.cxx
import mod;
poly p2;

int main() { return 0; }

Tested with multiple build systems (CMake and build2), on

  • trunk (c44e9ff691a10cd900b93d9ff4e0ada355ca82d7)

Edit: appears to be a regression, problem does not show up on 18.1.8 (3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff).

kamrann avatar Jul 02 '24 17:07 kamrann