[clang] [HLSL] Allow arrays to copy-initialize (PR #127557)

Chris B via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 18 10:52:47 PST 2025


================
@@ -6585,6 +6585,18 @@ void InitializationSequence::InitializeFrom(Sema &S,
       }
     }
 
+    if (S.getLangOpts().HLSL && Initializer && isa<ConstantArrayType>(DestAT)) {
----------------
llvm-beanz wrote:

Looking at this a bit. `canPerformArrayCopy` fails in cases that would otherwise be valid in HLSL. At least for HLSL today we can always copy an array if the source and destination type are the same, so we don't need to check that.

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


More information about the cfe-commits mailing list