<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:efriedma@codeaurora.org" title="Eli Friedman <efriedma@codeaurora.org>"> <span class="fn">Eli Friedman</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Meyers' singleton does not work with [[gnu::pure]] and -O1 to -O3"
href="https://bugs.llvm.org/show_bug.cgi?id=36750">bug 36750</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;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>REOPENED
</td>
<td>RESOLVED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Meyers' singleton does not work with [[gnu::pure]] and -O1 to -O3"
href="https://bugs.llvm.org/show_bug.cgi?id=36750#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Meyers' singleton does not work with [[gnu::pure]] and -O1 to -O3"
href="https://bugs.llvm.org/show_bug.cgi?id=36750">bug 36750</a>
from <span class="vcard"><a class="email" href="mailto:efriedma@codeaurora.org" title="Eli Friedman <efriedma@codeaurora.org>"> <span class="fn">Eli Friedman</span></a>
</span></b>
<pre>That's still wrong; the function writes to memory.
The point the gcc developer is making is that *if you can hide the
initialization from the compiler* then the function is "pure" because the
compiler can't prove when the initialization actually happened, so you can
pretend the function never had any side-effects in the first place. Here, the
compiler can see the initialization, so that reasoning doesn't work.</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>