[clang] [NFC][Clang] Adopt simplified `getTrailingObjects` in DeclFriend (PR #140081)

Rahul Joshi via cfe-commits cfe-commits at lists.llvm.org
Mon May 19 07:58:24 PDT 2025


================
@@ -90,8 +90,7 @@ class FriendDecl final
       : Decl(Decl::Friend, DC, L), Friend(Friend), FriendLoc(FriendL),
         EllipsisLoc(EllipsisLoc), UnsupportedFriend(false),
         NumTPLists(FriendTypeTPLists.size()) {
-    for (unsigned i = 0; i < NumTPLists; ++i)
-      getTrailingObjects<TemplateParameterList *>()[i] = FriendTypeTPLists[i];
+    llvm::copy(FriendTypeTPLists, getTrailingObjects());
----------------
jurahul wrote:

Keeping it copy to match the semantics of the code its replacing.

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


More information about the cfe-commits mailing list