> 
> 
> Concerning ideas on how the UnaryPlusChecker checker could be improved. What 
> about detecting "=+" written instead of "+=" as in the following test:
> 
> void test() {
>    unsigned int i = 7;
>    i =+ i;  // d you mean '+=' ?
>    i =+ 7;  // did you mean '+=' ?
> }
> 
> What do you think?

Clang already does this, as a compiler warning:

<stdin>:3:6: warning: use of unary operator that may be intended as compound
      assignment (+=)
   i =+ i;  // d you mean '+=' ?
     ^~
<stdin>:4:6: warning: use of unary operator that may be intended as compound
      assignment (+=)
   i =+ 7;  // did you mean '+=' ?
     ^~
 
…so I think we're good. :-)
Jordan
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to