<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 - Bogus warning with -Wweak-vtables when class declared inside .cpp file"
href="https://bugs.llvm.org/show_bug.cgi?id=33950">33950</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Bogus warning with -Wweak-vtables when class declared inside .cpp file
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</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>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>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>amomum@yandex.ru
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>clang -v
Ubuntu clang version 3.6.2-1 (tags/RELEASE_362/final) (based on LLVM 3.6.2)
Target: i386-pc-linux-gnu
This code:
class B
{};
class A : B
{
virtual void do_smthn()
{}
};
int main(void)
{
A a;
return 0;
}
compiled with:
"clang++ -Wweak-vtables"
produces bogus warning:
"'A' has no out-of-line virtual method definitions; its vtable will be emitted
in every translation unit [-Wweak-vtables]"
This should not happen since whole class definition is inside one translation
unit.
This warning dissapears if I surround class definition in anonymous namespace.</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>