[PATCH] D20964: [clang-tidy] Add modernize-use-emplace

Piotr Padlewski via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 17 09:37:42 PDT 2016


Prazek added inline comments.

================
Comment at: test/clang-tidy/modernize-use-emplace.cpp:2
@@ +1,3 @@
+// RUN: %check_clang_tidy %s modernize-use-emplace %t
+
+namespace std {
----------------
hokein wrote:
> Could you also add the following case in the test?
> ```
> vector<vector<int>> v1;
> v1.push_back(1<<10);
> ```
> 
> Make sure the check won't change to `v1.emplace_back(1<<10)`. Since these two statements have completely different semantic. The first one adds `1024` to `v1` while the second one adds a vector with 1024 elements to `v1`.
I think you have made some mistake, because the code that you have showed doesn't compile.


http://reviews.llvm.org/D20964





More information about the cfe-commits mailing list