<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 - clang incorrectly diagnoses use of deleted member of current instantiation in template"
href="https://bugs.llvm.org/show_bug.cgi?id=38380">38380</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang incorrectly diagnoses use of deleted member of current instantiation in template
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</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>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>rjmccall@apple.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Consider the following code:
template <class T> struct A {
static void foo() = delete;
static void bar() { foo(); }
};
template <> void A<int>::foo() {}
int main() { A<int>::bar(); }
Clang currently diagnoses this like so:
harza:sw:swift$ clang++ -fsyntax-only /tmp/red.cpp
/tmp/red.cpp:3:23: error: attempt to use a deleted function
static void bar() { foo(); }
^
/tmp/red.cpp:2:15: note: 'foo' has been explicitly marked deleted here
static void foo() = delete;
^
1 error generated.
And Clang is in good company when it does this, because every single other
compiler I tested gives essentially the same diagnostic.
However! I'm not sure this is actually ill-formed, because as far as I can
tell it is totally valid to have a non-deleted explicit specialization of a
member function of a class template.</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>