[clang-tools-extra] [clang-tidy][C++20] Add support for Initialization Forwarding in Nested Objects (PR #131969)

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 28 03:14:37 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
----------------
vbvictor wrote:

Maybe these test cases should be separated from other ones because they compile in cxx20

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


More information about the cfe-commits mailing list