[cfe-commits] [PATCH 2/2] Fix Casting

David Greene dag at cray.com
Tue Jan 8 13:49:25 PST 2013


Use const_cast<> to avoid a cast-away-const error.
---
 .../tools/clang/tools/libclang/IndexingContext.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/llvm/tools/clang/tools/libclang/IndexingContext.cpp b/llvm/tools/clang/tools/libclang/IndexingContext.cpp
index e4c33b6..680eb52 100644
--- a/llvm/tools/clang/tools/libclang/IndexingContext.cpp
+++ b/llvm/tools/clang/tools/libclang/IndexingContext.cpp
@@ -894,7 +894,7 @@ void IndexingContext::translateLoc(SourceLocation Loc,
   if (indexFile)
     *indexFile = getIndexFile(FE);
   if (file)
-    *file = (void *)FE;
+    *file = const_cast<FileEntry *>(FE);
   if (line)
     *line = SM.getLineNumber(FID, FileOffset);
   if (column)
-- 
1.7.8.4




More information about the cfe-commits mailing list