zmodem wrote:

> I'll prepare a revert to unblock for now and will work on bringing this back 
> in December.

Thanks! I hope we can help figure this out together.

I think the repro was maybe not exactly representative of the failure we're 
seeing. Here's another attempt:

```
$ cat /tmp/a.cc
void operator delete(void*, size_t) {}
void operator delete[](void*, size_t) {}

template <typename T> struct RefCounted {
  void operator delete[](void *p) { } // <--- Missing symbol.
};

struct __declspec(dllexport) DrawingBuffer : public RefCounted<DrawingBuffer> {
  DrawingBuffer();
  virtual ~DrawingBuffer();
};

DrawingBuffer::DrawingBuffer() {}
DrawingBuffer::~DrawingBuffer() {}

$ build/bin/clang-cl -fuse-ld=lld /GR- /LD /Zc:dllexportInlines- /tmp/a.cc 
/link /nodefaultlib /noentry
lld-link: error: undefined symbol: public: static void __cdecl 
RefCounted<struct DrawingBuffer>::operator delete[](void *)
>>> referenced by /tmp/a-f60332.obj:(public: virtual void * __cdecl 
>>> DrawingBuffer::`vector deleting dtor'(unsigned int))
clang-cl: error: linker command failed with exit code 1 (use -v to see 
invocation)
```

I suspect the issue is something along the lines of: because of 
`/Zc:dllexportInlines-`, `RefCounted<>::operator delete[]` is not dllexported, 
but treated as a regular inline function, which means it's only emitted when 
referenced, and although it is referenced by `DrawingBuffer::vector deleting 
dtor`, we fail to actually mark it as such, causing the link error.

https://github.com/llvm/llvm-project/pull/165598
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to