From 0a528db95d81bbc6d118e5d3fd752e52923547a1 Mon Sep 17 00:00:00 2001 From: David Greene Date: Tue, 15 Jan 2013 22:09:41 +0000 Subject: Fix Const Cast Do proper casting to avoid a cast-away-const error. llvm-svn: 172559 --- clang/lib/CodeGen/CodeGenModule.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenModule.cpp') diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 01bc66b..b1bdc0f 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -2280,7 +2280,8 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) { llvm::Constant *C = 0; if (isUTF16) { ArrayRef Arr = - llvm::makeArrayRef((uint16_t*)Entry.getKey().data(), + llvm::makeArrayRef(reinterpret_cast( + const_cast(Entry.getKey().data())), Entry.getKey().size() / 2); C = llvm::ConstantDataArray::get(VMContext, Arr); } else { -- cgit v1.1