From 68b4968481384bd02f8199c2b286aa7d0ddb08ca Mon Sep 17 00:00:00 2001 From: Mehdi Amini Date: Sat, 19 Mar 2016 01:24:23 +0000 Subject: [PATCH] Fix a const_cast related warning in GCC in the C API for libLTO From: Mehdi Amini llvm-svn: 263870 --- tools/lto/lto.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()}; }