[PATCH] Extend the check to detect patterns like 'ptr.get() == nullptr'

Samuel Benzaquen sbenza at google.com
Fri Apr 4 13:08:01 PDT 2014


Hi djasper,

Extend the check to detect patterns like 'ptr.get() == nullptr'
It detects == and != when any argument is a ptr.get() and the other is a
nullptr.
Only supports standard smart pointer types std::unique_ptr and std::shared_ptr.
Does not support the case 'ptr.get() == other.get()' yet.

http://llvm-reviews.chandlerc.com/D3294

Files:
  clang-tidy/misc/RedundantSmartptrGet.cpp
  test/clang-tidy/make_compile_commands_json.sh
  test/clang-tidy/redundant-smartptr-get-fix.cpp
  test/clang-tidy/redundant-smartptr-get.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3294.1.patch
Type: text/x-patch
Size: 8374 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140404/c059d0e4/attachment.bin>


More information about the cfe-commits mailing list