<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - -Wunneeded-member-function incorrect for default constructor"
href="https://llvm.org/bugs/show_bug.cgi?id=25084">25084</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>-Wunneeded-member-function incorrect for default constructor
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.6
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>david@doublewise.net
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>The following program incorrectly warns:
#include <vector>
namespace {
struct default_constructible {
default_constructible() = default;
};
} // namespace
int main() {
std::vector<default_constructible> v;
v.emplace_back();
}
clang++ source/main.cpp -std=c++14 -Wunneeded-member-function -o /dev/null
source/main.cpp:6:2: warning: member function 'default_constructible' is not
needed and will not be
emitted [-Wunneeded-member-function]
default_constructible() = default;
^
1 warning generated.
clang++ -v
clang version 3.6.2 (tags/RELEASE_362/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
Selected GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/5.2.0
Removing the default constructor leads to an error because emplace_back fails.</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>