kuhar added inline comments.
================ Comment at: test/clang-tidy/modernize-use-emplace.cpp:284 + // CHECK-FIXES: v.emplace_back(42LL, 13); + + v.push_back(std::make_pair<char, char>(0, 3)); ---------------- kuhar wrote: > Prazek wrote: > > I would add here test like: > > > > class X { > > X(std:;pair<int, int> a) {} > > }; > > > > std::vector<X> v; > > v.push_back(make_pair(42, 42)); > > > > I guess as long as X ctor is not explicit this can happen, and we can't > > transform it to > > emplace.back(42, 42) > Nice idea for a test case, added. A better test case would be to make X's ctor take a pair by const reference or rvalue reference. This way it wouldn't produce an extra CxxConstructExpr and will be currently (incorrectly) matched. This needs to be fixed. https://reviews.llvm.org/D32395 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits