Issue |
150563
|
Summary |
lld-link cannot find std::vector destructor in certain situations
|
Labels |
new issue
|
Assignees |
|
Reporter |
AlexB8675
|
using latest clang-cl and lld-link (20.1.8) on Windows 11 24H2 with latest build tools 17.14.9, the following code snippet fails to link
```cpp
#include <vector>
struct Foo {
int x;
};
struct Bar {
std::vector<Foo*> a;
std::vector<Foo*> b;
};
int main() {
auto _one_ = Foo(1);
auto* bar = new Bar(
{ &one },
{ &one }
);
return 0;
}
```
With the following terminal commands
```
D:\LLVM\bin\clang-cl.exe /nologo -TP -IC:\Users\Alex\Desktop\Test\build\_deps\mimalloc-src\include /DWIN32 /D_WINDOWS /EHsc /Ob0 /Od /RTC1 -clang:-std=c++23 -MDd -Zi /MDd /showIncludes /FoCMakeFiles\Test.dir\main.cpp.obj /FdCMakeFiles\Test.dir\ -c -- C:\Users\Alex\Desktop\Test\main.cpp
D:\LLVM\bin\lld-link.exe /nologo CMakeFiles\Test.dir\main.cpp.obj /out:Test.exe /implib:Test.lib /pdb:Test.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib
```
Workarounds include:
- Not using C++20's parenthesis aggregate init of `bar`
- Adding `delete` for `bar`
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs