Skip to content

Commit 13faed8

Browse files
committed
[clang][Interp][NFC] Use move ctor in moveArrayTy
Similar to what we did previously for primitive types, do it for primitive arrays as well.
1 parent 1299af6 commit 13faed8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/AST/Interp/Descriptor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static void moveArrayTy(Block *, const std::byte *Src, std::byte *Dst,
7676
Src += sizeof(InitMapPtr);
7777
Dst += sizeof(InitMapPtr);
7878
for (unsigned I = 0, NE = D->getNumElems(); I < NE; ++I) {
79-
const auto *SrcPtr = &reinterpret_cast<const T *>(Src)[I];
79+
auto *SrcPtr = &reinterpret_cast<T *>(const_cast<std::byte *>(Src))[I];
8080
auto *DstPtr = &reinterpret_cast<T *>(Dst)[I];
8181
new (DstPtr) T(std::move(*SrcPtr));
8282
}

0 commit comments

Comments
 (0)