[clang-tidy] Add a checker for implicit bool conversion of a bool*.

The goal is to find code like the example below, which is likely a typo
where someone meant to write "if (*b)".
bool *b = SomeFunction();
 if (b) {
   // b never dereferenced
 }

This checker naturally has a relatively high false positive rate so it
applies some heuristics to avoid cases where the pointer is checked for
nullptr before being written.

Differential Revision: http://reviews.llvm.org/D4458

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212797 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed the test to work with -implicit-check-not.


git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212811 91177308-0d34-0410-b5e6-96231b3b80d8
Modify the tests to use FileCheck -implicit-check-not option being proposed in D4462

Reviewers: djasper, sbenza, bkramer

Reviewed By: bkramer

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4463

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212814 91177308-0d34-0410-b5e6-96231b3b80d8
Fixed compilation errors in tests, enforce checking for errors in check_clang_tidy_fix.sh.

Reviewers: sbenza, djasper

Reviewed By: djasper

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4480

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212876 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] Reorder libdeps by alphabetical order.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212919 91177308-0d34-0410-b5e6-96231b3b80d8
[CMake] Update libdeps.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212920 91177308-0d34-0410-b5e6-96231b3b80d8
Suggest automated replacements of C-style casts with C++ casts.

Summary:
This patch implements a subset of possible replacements of C-style
casts with const_cast/static_cast/reinterpret_cast. This should cover a large
portion of cases in real code. Handling of a few more cases may be implemented
eventually.

Reviewers: sbenza, djasper

Reviewed By: djasper

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4478

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212924 91177308-0d34-0410-b5e6-96231b3b80d8
Set up clang-tidy diagnostic consumer to print types etc.

Reviewers: bkramer

Reviewed By: bkramer

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4494

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212941 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Add a checker for swapped arguments.

This looks for swapped arguments by looking at implicit conversions of arguments

void Foo(int, double);
Foo(1.0, 3); // Most likely a bug

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212942 91177308-0d34-0410-b5e6-96231b3b80d8
Fix build when various clang feature flags are enabled/disabled

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212994 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Add a checker that removes deducible arguments from std::make_pair

Those may be incompatible with C++11 and are unnecessary. We suggest
removing the template arguments when they match the types of the make_pair
arguments or replace it with std::pair and explicit template arguments when
not.

Differential Revision: http://reviews.llvm.org/D4497

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213058 91177308-0d34-0410-b5e6-96231b3b80d8
Prune Redundant libdeps in CMake's target_link_libraries and LLVMBuild.txt.

I checked this with Release+Asserts on x86_64-mingw32. Please restore partially if this were overkill.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213064 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Add a checker that flags all instances of overloaded unary operator&

This handles both methods and freestanding overloads.

Differential Revision: http://reviews.llvm.org/D4498

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213067 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] extend make_pair test for fixits in template definitions.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213068 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Add a checker that flags unnamed parameters.

Summary:
We still allow the escape hatch foo(int /*x*/) and also suggest this
in a fixit. This is more powerful than the corresponding cpplint.py check
it also flags functions with multiple arguments as naming all arguments is
recommended by the google style guide.

Reviewers: alexfh, djasper

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4518

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213075 91177308-0d34-0410-b5e6-96231b3b80d8
Fix the diagnostic.cpp test to explicitly disable more google checks

Imagine, hypothetically, that you had a build of clang-tidy that enabled
the google-* checks by default.  If you had such a binary, then this
test would fail.  Making it pass in that configuration isn't such a bad
thing.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213085 91177308-0d34-0410-b5e6-96231b3b80d8