[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in structs and Nested Objects within modernize-use-emplace (PR #131969)

David Rivera via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 29 11:28:27 PDT 2025


================
@@ -1289,7 +1305,11 @@ void testBracedInitTemporaries() {
   v2.push_back(NonTrivialWithVector{{0}});
   v2.push_back({{0}});
   v2.push_back(NonTrivialWithVector{std::vector<int>{0}});
+  // CHECK-MESSAGES-CPP20: :[[@LINE-1]]:6: warning: use emplace_back instead of push_back
----------------
RiverDave wrote:

I separated these in a different function within the same file, lmk if it doesn't make sense.

https://github.com/llvm/llvm-project/pull/131969


More information about the cfe-commits mailing list