[cfe-commits] [Patch] Warn about self-initialization of reference variables

Hans Wennborg hans at chromium.org
Thu Aug 16 02:36:11 PDT 2012


Hi all,

The attached patch makes Clang warn about self-initialization of
references, like:

  int &a = a;

Because that seems like a bad thing to do, and I don't think we should
suppress it like we do with "int x = x" which is a common way of
avoiding warnings about unused variables.

Please take a look.

Thanks,
Hans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: self_init_refs.patch
Type: application/octet-stream
Size: 4749 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120816/80b34928/attachment.obj>


More information about the cfe-commits mailing list