[PATCH] D32395: [clang-tidy] modernize-use-emplace: remove unnecessary make_pair calls

Piotr Padlewski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 23 04:37:48 PDT 2017


Prazek 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));
----------------
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)


https://reviews.llvm.org/D32395





More information about the cfe-commits mailing list