<div dir="ltr"><div>In <font face="monospace, monospace">DevirtModule::tryUniqueRetValOpt</font>, there's a lambda that starts like this:</div><div><br></div><div><pre style="font-family:Consolas;color:gainsboro;background:rgb(30,30,30)"><span style="color:rgb(87,166,74)">// IsOne controls whether we look for a 0 or a 1.</span>
<span style="color:rgb(86,156,214)">auto</span> <span style="color:rgb(200,200,200)">tryUniqueRetValOptFor</span> <span style="color:rgb(180,180,180)">=</span> <span style="color:rgb(180,180,180)">[&](</span><span style="color:rgb(86,156,214)">bool</span> <span style="color:rgb(127,127,127)">IsOne</span><span style="color:rgb(180,180,180)">)</span> <span style="color:rgb(180,180,180)">{</span>
<span style="color:rgb(86,156,214)">const</span> <span style="color:rgb(78,201,176)">BitSetInfo</span> <span style="color:rgb(180,180,180)">*</span><span style="color:rgb(200,200,200)">UniqueBitSet</span> <span style="color:rgb(180,180,180)">=</span> <span style="color:rgb(181,206,168)">0</span><span style="color:rgb(180,180,180)">;</span>
<span style="color:rgb(86,156,214)">for</span> <span style="color:rgb(180,180,180)">(</span><span style="color:rgb(86,156,214)">const</span> <span style="color:rgb(78,201,176)">VirtualCallTarget</span> <span style="color:rgb(180,180,180)">&</span><span style="color:rgb(200,200,200)">Target</span> <span style="color:rgb(180,180,180)">:</span> <span style="color:rgb(127,127,127)">TargetsForSlot</span><span style="color:rgb(180,180,180)">)</span> <span style="color:rgb(180,180,180)">{</span>
<span style="color:rgb(86,156,214)">if</span> <span style="color:rgb(180,180,180)">(</span><span style="color:rgb(200,200,200)">Target</span><span style="color:rgb(180,180,180)">.</span><span style="color:rgb(218,218,218)">RetVal</span> <span style="color:rgb(180,180,180)">==</span> <span style="color:rgb(127,127,127)">IsOne</span> <span style="color:rgb(180,180,180)">?</span> <span style="color:rgb(181,206,168)">1</span> <span style="color:rgb(180,180,180)">:</span> <span style="color:rgb(181,206,168)">0</span><span style="color:rgb(180,180,180)">)</span> <span style="color:rgb(180,180,180)">{</span>
<span style="color:rgb(86,156,214)">if</span> <span style="color:rgb(180,180,180)">(</span><span style="color:rgb(200,200,200)">UniqueBitSet</span><span style="color:rgb(180,180,180)">)</span>
<span style="color:rgb(86,156,214)">return</span> <span style="color:rgb(86,156,214)">false</span><span style="color:rgb(180,180,180)">;</span>
<span style="color:rgb(200,200,200)">UniqueBitSet</span> <span style="color:rgb(180,180,180)">=</span> <span style="color:rgb(200,200,200)">Target</span><span style="color:rgb(180,180,180)">.</span><span style="color:rgb(218,218,218)">BS</span><span style="color:rgb(180,180,180)">;</span>
<span style="color:rgb(180,180,180)">}</span>
<span style="color:rgb(180,180,180)">}</span>
</pre></div><div>I'm working on a patch to turn up the warning levels that LLVM compiles at, and I got a new warning:<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="monospace, monospace">C4805<span style="white-space:pre"> </span>'==': unsafe mix of type 'const uint64_t' and type 'bool' in operation</font></blockquote><div><br></div><div>...pointing at this line:</div><div><pre style="font-family:Consolas;color:gainsboro;background:rgb(30,30,30)"><span style="color:rgb(86,156,214)">if</span> <span style="color:rgb(180,180,180)">(</span><span style="color:rgb(200,200,200)">Target</span><span style="color:rgb(180,180,180)">.</span><span style="color:rgb(218,218,218)">RetVal</span> <span style="color:rgb(180,180,180)">==</span> <span style="color:rgb(127,127,127)">IsOne</span> <span style="color:rgb(180,180,180)">?</span> <span style="color:rgb(181,206,168)">1</span> <span style="color:rgb(180,180,180)">:</span> <span style="color:rgb(181,206,168)">0</span><span style="color:rgb(180,180,180)">)</span> <span style="color:rgb(180,180,180)">{</span>
</pre></div><div><br></div><div>It looks to me like that, instead of comparing <font face="monospace, monospace">Target.RetVal</font> <i><u><b>to</b></u></i> <font face="monospace, monospace">1</font> or <font face="monospace, monospace">0</font>, it's comparing <font face="monospace, monospace">Target.RetVal</font> <i><b><u>to</u></b></i> <font face="monospace, monospace">IsOne</font>, which I doubt is the intended outcome!</div><div><br></div><div>What's up with that? Is that a bug?</div><div><br></div><div><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><span style="font-size:12.8px">Sincerely,</span><br style="font-size:12.8px"><span style="font-size:12.8px">Alexander Riccio</span><br style="font-size:12.8px"><span style="font-size:12.8px">--</span><br style="font-size:12.8px"><span style="font-size:12.8px">"Change the world or go home."</span><div style="font-size:12.8px"><a href="http://about.me/ariccio" target="_blank">about.me/ariccio</a></div><div style="font-size:12.8px"><a href="http://about.me/ariccio" target="_blank"><br></a></div><div style="font-size:12.8px">If left to my own devices, I will build more.</div><div style="font-size:12.8px">⁂</div></div></div></div></div></div>
</div></div>