<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><blockquote type="cite"><div text="#000000" bgcolor="#FFFFFF" style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br><br>Concerning ideas on how the UnaryPlusChecker checker could be improved. What about detecting "=+" written instead of "+=" as in the following test:<br><br>void test() {<br>   unsigned int i = 7;<br>   i =+ i;  // d you mean '+=' ?<br>   i =+ 7;  // did you mean '+=' ?<br>}<br><br>What do you think?<br></div></blockquote></div><br><div>Clang already does this, as a compiler warning:</div><div><br></div><div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(148, 58, 32); background-color: rgb(223, 219, 196);"><b><stdin>:3:6: </b><span style="color: #c02ec0"><b>warning: </b></span><b>use of unary operator that may be intended as compound</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(148, 58, 32); background-color: rgb(223, 219, 196);"><b>      assignment (+=)</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">   i =+ i;  // d you mean '+=' ?</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 165, 0); background-color: rgb(223, 219, 196);"><b>     ^~</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(148, 58, 32); background-color: rgb(223, 219, 196);"><b><stdin>:4:6: </b><span style="color: #c02ec0"><b>warning: </b></span><b>use of unary operator that may be intended as compound</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(148, 58, 32); background-color: rgb(223, 219, 196);"><b>      assignment (+=)</b></div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);">   i =+ 7;  // did you mean '+=' ?</div><div style="margin: 0px; font-size: 11px; font-family: Menlo; color: rgb(0, 165, 0); background-color: rgb(223, 219, 196);"><b>     ^~</b></div></div><div> </div><div>…so I think we're good. :-)</div><div>Jordan</div></body></html>