<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:david@doublewise.net" title="David Stone <david@doublewise.net>"> <span class="fn">David Stone</span></a>
</span> changed
<a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - -Wunneeded-member-function incorrect for default constructor"
href="https://bugs.llvm.org/show_bug.cgi?id=25084">bug 25084</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>RESOLVED
</td>
<td>REOPENED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>INVALID
</td>
<td>---
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - -Wunneeded-member-function incorrect for default constructor"
href="https://bugs.llvm.org/show_bug.cgi?id=25084#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_REOPENED "
title="REOPENED - -Wunneeded-member-function incorrect for default constructor"
href="https://bugs.llvm.org/show_bug.cgi?id=25084">bug 25084</a>
from <span class="vcard"><a class="email" href="mailto:david@doublewise.net" title="David Stone <david@doublewise.net>"> <span class="fn">David Stone</span></a>
</span></b>
<pre>Sorry, I had incorrectly reduced this bug when I initially posted this. Here is
the correct test case:
#include <type_traits>
namespace {
struct default_constructible {
default_constructible() = default;
default_constructible(default_constructible const &) = delete;
default_constructible(default_constructible &&) = delete;
};
} // namespace
static_assert(std::is_default_constructible_v<default_constructible>);
<a href="https://godbolt.org/z/kieneu">https://godbolt.org/z/kieneu</a>
We need to explicitly default the default constructor because we delete another
special member function. The code does not compile without the `= default`
line. However, it is used only at compile time, and thus the function does not
need to be emitted for use at link-time, which is presumably why this warning
is being triggered.</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>