[cfe-commits] [patch] Warn on self assignment for member variables

Nico Weber thakis at chromium.org
Mon Jun 25 12:26:45 PDT 2012


Hi,

the attached patch adds a warning for self-assignments of member
variables. This is PR13104. I do this every now and then locally when
writing setter functions: I type "void set_var(int var) { var_ =" and
then try to hit ctrl-p twice to complete the lhs to "var" in vim, but
miss and hit it only once, so that I end up with "var_ = var_;"

This finds 0 bugs and 0 false positives in chromium, so I'm not sure
how useful this is. Opinions?

Nico
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-memvar-assign.patch
Type: application/octet-stream
Size: 4100 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120625/a3a204b0/attachment.obj>


More information about the cfe-commits mailing list