<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 --- - virtual deleted functions appear to be callable."
href="http://llvm.org/bugs/show_bug.cgi?id=20268">20268</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>virtual deleted functions appear to be callable.
</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>mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>#include <iostream>
#include <type_traits>
struct DeletedVirtualPublicDestructor { public: virtual
~DeletedVirtualPublicDestructor() = delete; };
struct DeletedVirtualProtectedDestructor { protected: virtual
~DeletedVirtualProtectedDestructor() = delete; };
struct DeletedVirtualPrivateDestructor { private: virtual
~DeletedVirtualPrivateDestructor() = delete; };
struct __two {char __lx[2];};
template <typename _Tp>
struct __is_destructor_wellformed {
template <typename _Tp1, typename _Tp2 =
decltype(std::declval<_Tp1&>().~_Tp1())>
static char __test (int);
template <typename _Tp1>
static __two __test (...);
static const bool value = sizeof(__test<_Tp>(12)) == sizeof(char);
};
int main () {
std::cout <<
__is_destructor_wellformed<DeletedVirtualPublicDestructor>::value << std::endl;
}
I expect this code to print '0', but it prints '1'.
Note that if I remove the "virtual" from DeletedVirtualPublicDestructor, it
prints '0'.
Tested with:
clang version 3.5.0 (trunk 212619)
Target: x86_64-apple-darwin13.3.0</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>