[PATCH] D17811: [clang-tidy] Add check to detect dangling references in value handlers.

Samuel Benzaquen via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 2 08:22:10 PST 2016


sbenza created this revision.
sbenza added a reviewer: alexfh.
sbenza added a subscriber: cfe-commits.

Add check misc-dangling-handle to detect dangling references in value
handlers like std::experimental::string_view.
It provides a configuration option to specify other handle types that
should also be checked.

Right now it detects:
 - Construction from temporaries.
 - Assignment from temporaries.
 - Return statements from temporaries or locals.
 - Insertion into containers from temporaries.

http://reviews.llvm.org/D17811

Files:
  clang-tidy/misc/CMakeLists.txt
  clang-tidy/misc/DanglingHandleCheck.cpp
  clang-tidy/misc/DanglingHandleCheck.h
  clang-tidy/misc/MiscTidyModule.cpp
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/checks/misc-dangling-handle.rst
  test/clang-tidy/misc-dangling-handle.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17811.49629.patch
Type: text/x-patch
Size: 18232 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160302/6708bb97/attachment-0001.bin>


More information about the cfe-commits mailing list