<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 - [Microsoft ABI] Inline destructors are not emitted when a virtual subclass's complete destructor is used"
href="https://bugs.llvm.org/show_bug.cgi?id=38521">38521</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[Microsoft ABI] Inline destructors are not emitted when a virtual subclass's complete destructor is used
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>6.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows XP
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>LLVM Codegen
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ngg@tresorit.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>In the following example the X<void>::~X<void> destructor is not emitted in
either TU.
If I understand correctly, it should be emitted when compiling "a.cpp" where
Y's complete destructor is used because of:
// A TU defining a non-inline destructor is only guaranteed to emit a base
// destructor, and all of the other variants are emitted on an as-needed basis
// in COMDATs. Because a non-base destructor can be emitted in a TU that
// lacks a definition for the destructor, non-base destructors must always
// delegate to or alias the base destructor.
Compile with:
clang++ -target i386-pc-windows-msvc -fuse-ld=lld-link -nostdlib
-Wl,/ENTRY:start a.cpp b.cpp
/usr/bin/lld-link: error: /tmp/a-785134.o: undefined symbol: ??1?$X@X@@QAE@XZ
Example:
// foo.hpp
#pragma once
template <class>
struct X {
~X() {}
};
struct Y : virtual X<void> {
~Y();
};
// a.cpp
#include "foo.hpp"
extern "C" void start()
{
Y* y;
y->~Y();
}
// b.cpp
#include "foo.hpp"
Y::~Y() {}</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>