[PATCH] D135405: fix handling of braced-init temporaries for modernize-use-emplace

Peter Wolf via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 15 23:54:28 PST 2022


BigPeet added a comment.

Thanks for the review. Do I have to do anything or how will this be handled from here?



================
Comment at: clang-tools-extra/test/clang-tidy/checkers/modernize/use-emplace.cpp:1268
+
+  v2.emplace_back(NonTrivialWithVector());
+  // CHECK-MESSAGES: :[[@LINE-1]]:19: warning: unnecessary temporary object created while calling emplace_back
----------------
njames93 wrote:
> Is this a test case that wasn't already caught, as braces aren't being used here
This case was/is already caught. I added this check (and a few others) to make sure I don't break that behavior.
It might be redundant and could be removed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135405/new/

https://reviews.llvm.org/D135405



More information about the cfe-commits mailing list