<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jul 14, 2011, at 5:49 PM, Richard Trieu wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word"><div><br></div>Unless I misunderstood the effect, it also eliminates some true positives as well, in code like<div>
<br></div><div><span style="white-space:pre-wrap"> </span>if (dependent-thing && 0)</div></div></blockquote><div><br></div><div> </div></div>This change will still catch such an example, since the value-dependent check is only on the right hand side. If you check the test cases, there is an example of such a thing. See the excerpt of the test below.<div>
<span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "><br></span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); ">+template<unsigned int A, unsigned int B> struct S</span></div>
<div>...</div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); ">+ e2 = A && 7 // expected-warning {{use of logical && with constant operand; switch to bitwise & or remove constant}}</span></div>
<div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); ">...</span></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); ">+ int y = B && 3; // expected-warning {{use of logical && with constant operand; switch to bitwise & or remove constant}}</span></div></blockquote><br></div><div>Interesting, okay. Then the patch looks fine; thanks!</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- Doug</div></body></html>