diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp index c6101a56f8c..3af8f7d3297 100644 --- a/tools/lto/lto.cpp +++ b/tools/lto/lto.cpp @@ -469,7 +469,7 @@ LTOObjectBuffer thinlto_module_get_object(thinlto_code_gen_t cg, unsigned int index) { assert(index < unwrap(cg)->getProducedBinaries().size() && "Index overflow"); auto &MemBuffer = unwrap(cg)->getProducedBinaries()[index]; - return LTOObjectBuffer{(void *)MemBuffer->getBufferStart(), + return LTOObjectBuffer{const_cast(MemBuffer->getBufferStart()), MemBuffer->getBufferSize()}; }