<html>
<head>
<base href="http://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 --- - "final" and "override" specifiers are not recognized for some methods of class templates"
href="http://llvm.org/bugs/show_bug.cgi?id=21942">21942</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>"final" and "override" specifiers are not recognized for some methods of class templates
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>dmichael@chromium.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>"final" and "override" specifiers are not recognized for some methods of class
templates. It seems primarily to affect methods that are declared in the class
definition, but specialized outside the class definition.
I found this first when working on a fix to Chromium's style checker plugin,
but it appears that the problem also affects clang-modernize and the compiler
itself. See:
<a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Duplicate "override" added when dealing with template specialization"
href="show_bug.cgi?id=18440">http://llvm.org/bugs/show_bug.cgi?id=18440</a>
for the clang-tools-extra bug.
Here's a small reproducer:
=============================================
template<int> struct A
{
virtual void foo() final;
};
template<> void A<0>::foo() {}
struct B : A<0>
{
virtual void foo() override {};
};
=============================================
Note that B::foo() overrides a final method, but I get no diagnostic. If
A::foo() is defined in the body of A without specialization, the diagnostic
appears.</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>