[clang] [Clang][Sema] Fix wrong initialization kind when handling initializing structured bindings from an array with direct-list-initialization (PR #124793)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 28 10:49:04 PST 2025


================
@@ -4861,8 +4861,9 @@ static void TryListInitialization(Sema &S,
             S.Context.hasSameUnqualifiedType(SubInit[0]->getType(), DestType) &&
             "Deduced to other type?");
         TryArrayCopy(S,
-                     InitializationKind::CreateCopy(Kind.getLocation(),
-                                                    InitList->getLBraceLoc()),
+                     InitializationKind::CreateDirect(Kind.getLocation(),
+                                                      InitList->getLBraceLoc(),
+                                                      InitList->getRBraceLoc()),
----------------
Endilll wrote:

I think your understanding is correct.

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


More information about the cfe-commits mailing list