From: David Greene Date: Tue, 15 Jan 2013 22:09:49 +0000 (+0000) Subject: Fix Casting X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3cfa5324ef1c5f75fe5e142bef8050aaf2f03704;p=clang Fix Casting Use const_cast<> to avoid a cast-away-const error. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172564 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/libclang/CXSourceLocation.cpp b/tools/libclang/CXSourceLocation.cpp index a6a031edd8..2b3a300f0d 100644 --- a/tools/libclang/CXSourceLocation.cpp +++ b/tools/libclang/CXSourceLocation.cpp @@ -232,7 +232,7 @@ void clang_getExpansionLocation(CXSourceLocation location, } if (file) - *file = (void *)SM.getFileEntryForSLocEntry(sloc); + *file = const_cast(SM.getFileEntryForSLocEntry(sloc)); if (line) *line = SM.getExpansionLineNumber(ExpansionLoc); if (column) @@ -309,7 +309,7 @@ void clang_getSpellingLocation(CXSourceLocation location, return createNullLocation(file, line, column, offset); if (file) - *file = (void *)SM.getFileEntryForID(FID); + *file = const_cast(SM.getFileEntryForID(FID)); if (line) *line = SM.getLineNumber(FID, FileOffset); if (column)