llvm-project/clang-tools-extra/clang-tidy
Jakub Kuderski f8d872c66e [clang-tidy] Fix PR32896: detect initializer lists in modernize-use-empalce
Summary:
This patch fixes [[ https://bugs.llvm.org/show_bug.cgi?id=32896 | PR32896 ]].

The problem was that modernize-use-emplace incorrectly removed changed push_back into emplace_back, removing explicit constructor call with initializer list parameter, resulting in compiler error after applying fixits.
modernize-use-emplace used to check if matched constructor had InitListExpr, but didn't check against CXXStdInitializerListExpr.

Eg.

```
std::vector<std::vector<int>> v;
  v.push_back(std::vector<int>({1})); // --> v.emplace_back({1});
```

Reviewers: Prazek, alexfh, aaron.ballman

Reviewed By: Prazek, alexfh, aaron.ballman

Subscribers: xazax.hun, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 302281
2017-05-05 20:35:30 +00:00
..
boost [clang-tidy] boost-use-to-string arg expr location bugfix 2016-06-28 08:16:20 +00:00
cert [clang-tidy] Add cert-dcl58-cpp (do not modify the 'std' namespace) check. 2017-02-17 08:52:51 +00:00
cppcoreguidelines Spelling mistakes in comments. NFCI. 2017-03-30 13:10:33 +00:00
google [clang-tidy] Fix google-explicit-constructor issue with out-of-line conversions 2017-04-18 17:26:00 +00:00
hicpp [clang-tidy] fix for linker errors in hicpp checks 2017-03-30 12:31:02 +00:00
llvm modernize-use-auto NFC fixes 2016-12-14 15:29:23 +00:00
misc [clang-tidy] Fix misc-move-const-arg for move-only types. 2017-05-05 17:33:49 +00:00
modernize [clang-tidy] Fix PR32896: detect initializer lists in modernize-use-empalce 2017-05-05 20:35:30 +00:00
mpi modernize-use-auto NFC fixes 2016-12-14 15:29:23 +00:00
performance [clang-tidy] Support detecting for-range loop in inefficient-vector-operation check. 2017-04-26 18:13:05 +00:00
plugin [clang-tidy] fix missing anchor for MPI Module 2016-12-16 09:14:47 +00:00
readability [clang-tidy] fix readability-implicit-bool-cast false positive with xor 2017-05-04 16:06:08 +00:00
tool [clang-tidy] run-clang-tidy.py: check if clang-apply-replacements succeeds 2017-04-25 22:38:39 +00:00
utils Extend readability-container-size-empty to add comparisons to empty-state objects. 2017-04-24 14:57:09 +00:00
CMakeLists.txt Rename the clang-tidy safety module to be hicpp, for the High-Integrity C++ coding standard from PRQA. 2017-03-19 17:23:23 +00:00
ClangTidy.cpp [clang-tidy] Reuse FileID in getLocation 2017-04-06 20:19:26 +00:00
ClangTidy.h [clang-tidy] Add FormatStyle configuration option. 2017-04-06 13:41:29 +00:00
ClangTidyDiagnosticConsumer.cpp [clang-tidy] Fix treating non-space whitespaces in checks list. 2017-03-23 16:32:06 +00:00
ClangTidyDiagnosticConsumer.h [clang-tidy] Add FormatStyle configuration option. 2017-04-06 13:41:29 +00:00
ClangTidyModule.cpp Apply performance-unnecessary-value-param to clang-tidy. 2016-06-15 15:46:10 +00:00
ClangTidyModule.h [clang-tools-extra] Format sources with clang-format. NFC. 2016-11-08 07:50:19 +00:00
ClangTidyModuleRegistry.h Reapply r276973 "Adjust Registry interface to not require plugins to export a registry" 2016-08-05 11:01:08 +00:00
ClangTidyOptions.cpp [clang-tidy] Add FormatStyle configuration option. 2017-04-06 13:41:29 +00:00
ClangTidyOptions.h [clang-tidy] Add FormatStyle configuration option. 2017-04-06 13:41:29 +00:00
add_new_check.py [clang-tidy] Rename modernize-use-default to modernize-use-equals-default 2016-12-01 17:24:42 +00:00
rename_check.py [clang-tidy] Improve rename_check.py. 2016-11-08 11:43:50 +00:00