<html>
<head>
<base href="https://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 --- - Subscript operator applied to an temporary array results in an lvalue"
href="https://llvm.org/bugs/show_bug.cgi?id=25357">25357</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Subscript operator applied to an temporary array results in an lvalue
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.7
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</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++14
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>yaghmour.shafik@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>This Stackoverflow question
<a href="http://stackoverflow.com/questions/33161003/using-a-temporary-array-as-an-lvalue">http://stackoverflow.com/questions/33161003/using-a-temporary-array-as-an-lvalue</a>
provides the following code:
using Y = int[10];
int main() {
(Y { })[0] = 1;
}
which compiles without diagnostic, if I am reading CWG defect report 1213
correctly <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1213">http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1213</a>
then the result of the subscript operator should be an xvalue and therefore
not assignable to. Is this a correct interpretation?
The clang defect report status page does list the status of DR 1213 as unknown
<a href="http://clang.llvm.org/cxx_dr_status.html">http://clang.llvm.org/cxx_dr_status.html</a> but since this has come up on a couple
of SO questions already I thought it was worth it to file a bug report.
I have a Wandbox example here
<a href="http://melpon.org/wandbox/permlink/tiLfQnvsvBsAtNZv">http://melpon.org/wandbox/permlink/tiLfQnvsvBsAtNZv</a></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>