From 60053cf547af2ff5724406c5eb14a365d2552ef2 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sun, 4 Sep 2011 20:26:28 +0000 Subject: [PATCH] Use const_cast to avoid warnings. llvm-svn: 139104 --- clang/lib/Lex/Preprocessor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp index 3175d0450ec9..d33d9c513da9 100644 --- a/clang/lib/Lex/Preprocessor.cpp +++ b/clang/lib/Lex/Preprocessor.cpp @@ -312,7 +312,7 @@ bool Preprocessor::SetCodeCompletionPoint(const FileEntry *File, MemoryBuffer *NewBuffer = MemoryBuffer::getNewUninitMemBuffer(Buffer->getBufferSize() + 1, Buffer->getBufferIdentifier()); - char *NewBuf = (char*)NewBuffer->getBufferStart(); + char *NewBuf = const_cast(NewBuffer->getBufferStart()); char *NewPos = std::copy(Buffer->getBufferStart(), Position, NewBuf); *NewPos = '\0'; std::copy(Position, Buffer->getBufferEnd(), NewPos+1);