<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 --- - illegal use of decltype in destructor silently accepted"
href="http://llvm.org/bugs/show_bug.cgi?id=15801">15801</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>illegal use of decltype in destructor silently accepted
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.1
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>other
</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++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mmehlich@semanticdesigns.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>Source code:
extern "C" int printf(const char *, ...);
struct C {
C *c;
C() { printf("CREATE\n"); }
~decltype(*c)() { printf("DECLTYPE DESTROY\n"); }
~C() { printf("DESTROY\n"); }
};
int main() {
C c{};
}
The line ~decltype(*c)()... should be reported as malformed as the destructor
must use the name of the destructor's class (12.4).
Using the compilation command
clang -std=c++11 test.cpp -o out.exe -stdc++
the code does compile without any errors or warning.
The resulting executable calls the user-provided constructor C()
but no user-provided destructor...
-- version of clang used:
<span class="quote">>>> clang -v</span >
clang version 3.1 (branches/release_31)
Target: i386-pc-cygwin
Thread model: posix</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>