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

Samuel Benzaquen sbenza at google.com
Mon Apr 7 10:43:24 PDT 2014


On Mon, Apr 7, 2014 at 1:14 PM, Manuel Klimek <klimek at google.com> wrote:

> On Mon, Apr 7, 2014 at 6:29 PM, Samuel Benzaquen <sbenza at google.com>wrote:
>
>>   Fixed the typo on shared_ptr and added a shared_ptr to the test.
>>
>>   Fixed the -fix.cpp test to actually check the output.
>>   FileCheck can match the CHECK: lines with themselves if you don't
>> remove them from the input.
>>
>
> Any reason not to use the same pattern in all tests (they get cargo culted
> a lot).
>

I am figuring out how FileCheck works as I go.
I have been also wondering why we don't have all these as scripts. imo, the
test should have a single line at the top:
  // RUN: check_clang_tidy_fix.sh <check-name> %s %t %T
or something like that. Instead of copying the same N lines everywhere (and
changing them slightly).


>
>
>>
>> Hi djasper, klimek-test,
>>
>> http://reviews.llvm.org/D3294
>>
>> CHANGE SINCE LAST DIFF
>>   http://reviews.llvm.org/D3294?vs=8382&id=8411#toc
>>
>> 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 --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140407/bfa53a70/attachment.html>


More information about the cfe-commits mailing list