[clang-tidy] Use new ASTMatchers to identify template instantiations instead of copying it everywhere.

No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@217035 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Eliminate inline copies of InTemplateInstantiation matcher.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@217036 91177308-0d34-0410-b5e6-96231b3b80d8
ClangTidy misc-argument-comment check: don't check arguments to template
parameter packs.

Summary:
This disables this check for std::bind and similar functions that use
parameter packs to forward arguments to a different function. Name of the
parameter pack argument doesn't matter.

Reviewers: klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@217039 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Add an option to export suggested fixes into a file.

Allows gathering fixes and applying them with clang-apply-fixes.

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@217139 91177308-0d34-0410-b5e6-96231b3b80d8
Implemented clang-tidy configurability via .clang-tidy files.

Summary:
This adds a support for the .clang-tidy file reading using
FileOptionsProvider, -dump-config option, and changes tests to not depend on
default checks set.

Reviewers: klimek, bkramer, djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@217155 91177308-0d34-0410-b5e6-96231b3b80d8
Plug a unit test memory leak.

MatchFinder.addMatcher doesn't take ownership.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@217162 91177308-0d34-0410-b5e6-96231b3b80d8
Don't write files with no fixes.

git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@217163 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Add check for possibly incomplete switch statements

While clang warns about a possibly incomplete switch statement when
switching over an enum variable and failing to cover all enum values
(either explicitly or with a default case), no such warning is emitted
if a plain integer variable is used as switch variable.

Add a clang-tidy check to diagnose these scenarios.

No fixit hint is provided since there are multiple possible solutions.
Catch switches on *all* non-enum types
Formatting: end-of-namespace identifiers
Remove unneeded and unwanted include