<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Clang-cl link error virtual dtor of virtual base"
   href="https://bugs.llvm.org/show_bug.cgi?id=38524">38524</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Clang-cl link error virtual dtor of virtual base
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>7.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jvapen@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=20674" name="attach_20674" title="Copy of reproduction">attachment 20674</a> <a href="attachment.cgi?id=20674&action=edit" title="Copy of reproduction">[details]</a></span>
Copy of reproduction

This bug looks a lot like a previous one I logged,
however, this contains the fixes of the bug it was merged with.
I've encountered the issue with both LLVM 6.0 as 7.0-RC1

All files below can be found in copy in the attachment

Error:
------
t.clang.obj : error LNK2019: unresolved external symbol "public: virtual
__cdecl C::~C(void)" (??1C@@UEAA@XZ) referenced in function "public: virtual
__cdecl G::~G(void)" (??1G@@UEAA@XZ)

Run.cmd
-------
cl.exe /nologo /c  /GR /EHsc   /std:c++17  /O2    t.cpp -w
cl.exe /nologo /c  /GR /EHsc   /std:c++17  /O2    u.cpp -w

move t.obj t.msvc.obj
move u.obj u.msvc.obj
link t.msvc.obj u.msvc.obj


e:\development\jva\other\software\llvm_7_0_0_r336178\bin\clang-cl.exe
-fms-compatibility-version=19.11  /nologo /c  /GR /EHsc   /std:c++17  /O2   
t.cpp -w
e:\development\jva\other\software\llvm_7_0_0_r336178\bin\clang-cl.exe
-fms-compatibility-version=19.11  /nologo /c  /GR /EHsc   /std:c++17  /O2   
u.cpp -w

move t.obj t.clang.obj
move u.obj u.clang.obj
link t.clang.obj u.clang.obj

t.h
---
class A {
public:
  virtual ~A() = default;
};
class B {
public:
  virtual ~B() = default;
};
class C : public B {
public:
  C() = default;
};
class D : public virtual C, public A {
public:
  virtual ~D() override = default;
};
class __declspec(dllexport) E {
public:
  explicit E();
  virtual ~E();
  E(const E &other) = delete;
  E &operator=(const E &rhs) = delete;
  E(E &&other);
  E &operator=(E &&rhs) = delete;
};
class __declspec(dllexport) F : public D, protected E {
public:
  explicit F();
  virtual ~F();
};
class __declspec(dllexport) G final {
public:
  explicit G();
  virtual ~G();
  F f;
};

t.cpp
-----
#include "t.h"
G::G() = default;
G::~G() = default;
int main(int, char **) {}

u.cpp
-----
#include "t.h"

E::E() = default;
E::~E() = default;
E::E(E &&) = default;

F::F() = default;
F::~F() = default;</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>