[PATCH] D22541: [ADT] Warn on unused results from ArrayRef and StringRef functions that read like they might mutate.

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 15:12:33 PDT 2016


jlebar created this revision.
jlebar added a reviewer: majnemer.
jlebar added subscribers: llvm-commits, chandlerc, sanjoy.

Functions like "slice" and "drop_front" sound like they might mutate the
underlying object, but they don't.  Warning on unused results would have
saved me an hour yesterday, and I'm sure I'm not the only one.

LLVM and Clang are clean wrt this warning after D22540.

https://reviews.llvm.org/D22541

Files:
  include/llvm/ADT/ArrayRef.h
  include/llvm/ADT/StringRef.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22541.64574.patch
Type: text/x-patch
Size: 5476 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160719/a81aebb2/attachment.bin>


More information about the llvm-commits mailing list