<div dir="ltr">Hi David,<div><br></div><div>So I guess this is expected behaviour. Thanks.
</div><div><br></div><div>Regards,</div><div><br></div><div>Billy.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 18, 2020 at 6:39 PM David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">GCC doesn't seem to warn on this either. On the basis of the original warning I could see how this case could merit similar handling - but I doubt we'd want to add that handling to the existing flag at this point (due to the number of people over the decades that have used the warning for the behavior it currently provides, not expecting the new/additional behavior for the ternary operator or other bool-testing assignment situations (eg: "void f(bool); f(x = 5);")</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 18, 2020 at 6:53 AM Billy Araujo via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">-Wparentheses<br><div><br></div><div>warns for line 3 but not for the ternary expression in line 2.</div><div><br></div><div>1 static void foo(int a, int b, int x) {<br>2 x = (x = 10) ? a : b;<br>3 if (x = 10) { x = a; } else { x = b; }<br>4 }<br></div><div><br></div><div>Is this a bug?</div><div><br></div><div>Regards,</div><div><br></div><div>Billy. </div><div><br></div></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>
</blockquote></div>