<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 - wrong semantic check to prvalue as decltype operand"
href="https://bugs.llvm.org/show_bug.cgi?id=45542">45542</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>wrong semantic check to prvalue as decltype operand
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>9.0
</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++17
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>frankhb1989@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Case:
struct S
{
~S() = delete;
};
S f();
int main()
{
using X = decltype(f()); // #1
using Y = decltype(S{}); // #2
}
#2 is wrongly rejected in C++17 mode.
#1 is not ill-formed for the deleted destructor as per C++11
[dcl.type.simple]/5:
<span class="quote">> ... in the case where the operand of a decltype-specifier</span >
is a function call and the return type of the function is a class type, a
special rule (5.2.2) ensures that the return type is not required to be
complete (as it would be if the call appeared in a sub-expression or outside of
a
decltype-specifier) ... In particular, it is not necessary to allocate storage
for a temporary object or to enforce the semantic constraints associated with
invoking the type's destructor. ...
This rule is expanded by P0135R1 for cases like #2, which is adopted in C++17.
(See also P0929R2.)</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>