[clang-tidy] modernize-use-emplace: remove unnecessary make_pair calls
authorJakub Kuderski <kubakuderski@gmail.com>
Fri, 28 Apr 2017 16:25:45 +0000 (16:25 +0000)
committerJakub Kuderski <kubakuderski@gmail.com>
Fri, 28 Apr 2017 16:25:45 +0000 (16:25 +0000)
commit2a43d71765a124f25d832d780de04d5200faa1b3
treec907ce8e25615b88dbc3743065ba28c7a6edbc94
parent65e448422cd62c7ab4584291e141533ade73c799
[clang-tidy] modernize-use-emplace: remove unnecessary make_pair calls

Summary:
When there is a push_back with a call to make_pair, turn it into emplace_back and remove the unnecessary make_pair call.

Eg.

```
std::vector<std::pair<int, int>> v;
v.push_back(std::make_pair(1, 2)); // --> v.emplace_back(1, 2);
```

make_pair doesn't get removed when explicit template parameters are provided, because of potential problems with type conversions.

Reviewers: Prazek, aaron.ballman, hokein, alexfh

Reviewed By: Prazek, alexfh

Subscribers: JDevlieghere, JonasToth, cfe-commits

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D32395

llvm-svn: 301651
clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.cpp
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-tidy/checks/modernize-use-emplace.rst
clang-tools-extra/test/clang-tidy/modernize-use-emplace.cpp