[clang-tidy] Fix a heap use-after-free bug detected by asan.

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

Most of the changes are mechanic std::unique_ptr insertions. All leaks were
detected by LeakSanitizer.

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213851 91177308-0d34-0410-b5e6-96231b3b80d8
clang-tidy: [use-override] Tweak messages.

It doesn't make sense to suggest 'virtual' as clang-tidy would complain
about that on the next iteration (we are never issuing warnings for the
base function).

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@214063 91177308-0d34-0410-b5e6-96231b3b80d8
Don't warn on NewCallback argument comments, as they are arguments for the
function the callback points to.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

git-svn-id: http://llvm.org/svn/llvm-project/clang-tools-extra/trunk@214307 91177308-0d34-0410-b5e6-96231b3b80d8
[clang-tidy] Add a checker for code that looks like a delegate constructors but doesn't delegate.

Summary:
class Foo {
  Foo() {
    Foo(42); // oops
  }
  Foo(int);
};

This is valid code but it does nothing and we can't emit a warning in clang
because there might be side effects. The checker emits a warning for this
pattern and also for base class initializers written in this style.

There is some overlap with the unused-rtti checker but they follow different
goals and fire in different places most of the time.

Reviewers: alexfh, djasper

Subscribers: cfe-commits

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

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