#include <vector>
struct __declspec(dllimport) Cat {
virtual ~Cat();
};
struct Dog {
std::vector<Cat> v;
Dog() { v.emplace_back(); }
};
int main() { }
C:\Temp>cl /EHsc /nologo /W4 /std:c++17 meow.cpp
meow.cpp
C:\Temp>cl /EHsc /nologo /W4 /std:c++20 meow.cpp
meow.cpp
meow.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl Cat::~Cat(void)" (__imp_??1Cat@@UEAA@XZ) referenced in function "public: virtual void * __cdecl Cat::`scalar deleting destructor'(unsigned int)" (??_GCat@@UEAAPEAXI@Z)
meow.exe : fatal error LNK1120: 1 unresolved externals
@cdacamar believes this was regressed by #1546. I don't know enough about dllimport and "scalar deleting destructors" to immediately diagnose this - it may be by design (I know that C++20 constexpr vector required a bunch of our logic to change) or it may be unintentional/avoidable.
Originally reported as DevCom-1635853 and internal VSO-1461416 / AB#1461416 .