<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 --- - type-name alias in unqualified-id used in explicit destructor call not handled correctly"
href="http://llvm.org/bugs/show_bug.cgi?id=18879">18879</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>type-name alias in unqualified-id used in explicit destructor call not handled correctly
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.4
</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>filip.roseen@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>Created <span class=""><a href="attachment.cgi?id=12080" name="attach_12080" title="foo.cpp">attachment 12080</a> <a href="attachment.cgi?id=12080&action=edit" title="foo.cpp">[details]</a></span>
foo.cpp
struct A { };
typedef A A_alias;
int main () {
A ().A_alias::~A_alias (); // valid according to [class.dtor]p13
}
-----------------------------------------------
testcase.cpp:5:18: error: expected the class name after '~' to name a
destructor
A ().A_alias::~A_alias (); // valid according to [class.dtor]p13
^
1 error generated.
-----------------------------------------------
As stated under [class.dtor]p13:
> In an explicit destructor call, the destructor name appears as a ~
> followed by a type-name or decltype-specifier that denotes the
> destructors class type.
> <snip>
> An explicit destructor call must always be written using a member
> access operator (5.2.5) or a qualified-id (5.1)
There's an example in the mentioned section matching our testcase
`B_ptr->B_alias::~B_alias ();` (which, as implied, is legal).
gcc and icc both handles the case correctly (and accepts the code).</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>