<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed" title="RESOLVED INVALID - static_assert fails when applied to function parameter" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23776&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=ilhOrOFn9umBEBac0bTND-PCryU-_wc1uqu-1u_hgxk&s=LwM5tzh_xP4fuihky395pFYJVh8lP_rT9cvzzVEHqh8&e=">bug 23776</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>richard-llvm@metafoo.co.uk
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed" title="RESOLVED INVALID - static_assert fails when applied to function parameter" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23776-23c1&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=ilhOrOFn9umBEBac0bTND-PCryU-_wc1uqu-1u_hgxk&s=moziWo7YG42vy259tY1XprQZlttyyNsNEc-xHgMIxfA&e=">Comment # 1</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed" title="RESOLVED INVALID - static_assert fails when applied to function parameter" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23776&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=ilhOrOFn9umBEBac0bTND-PCryU-_wc1uqu-1u_hgxk&s=LwM5tzh_xP4fuihky395pFYJVh8lP_rT9cvzzVEHqh8&e=">bug 23776</a>
from <span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span></b>
<pre>Sorry, Clang is correct here. The subexpression 'm' makes this expression
non-constant per [expr.const] (5.20)/2.9, because this means the static_assert
condition contains:
"an id-expression that refers to a variable or data member of reference type
unless the reference has a preceding initialization and either
— it is initialized with a constant expression or
— it is a non-static data member of an object whose lifetime began within the
evaluation of e;"
(Basically, the evaluation of the expression 'm' attempts to resolve which
object is denoted by the reference, which fails.)</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>