aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2010-06-17 11:29:31 +0000
committerGabor Greif <ggreif@gmail.com>2010-06-17 11:29:31 +0000
commit170e5080011acc60e33ec9b53f96c569a1078aa9 (patch)
treef6e8fbbfb599ae6c261da0760aad81cea45bef27
parent40844a8b5a89676fb61898d61ea4a7fa98eb9b6b (diff)
fix some more gcc3.4 constness warnings
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106216 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/TypeLoc.h2
-rw-r--r--include/clang/Lex/Token.h2
-rw-r--r--lib/Sema/SemaExprCXX.cpp3
3 files changed, 4 insertions, 3 deletions
diff --git a/include/clang/AST/TypeLoc.h b/include/clang/AST/TypeLoc.h
index e043135f2f..08b2829f14 100644
--- a/include/clang/AST/TypeLoc.h
+++ b/include/clang/AST/TypeLoc.h
@@ -142,7 +142,7 @@ private:
/// \brief Return the TypeLoc for a type source info.
inline TypeLoc TypeSourceInfo::getTypeLoc() const {
- return TypeLoc(Ty, (void*)(this + 1));
+ return TypeLoc(Ty, const_cast<TypeSourceInfo*>(this + 1));
}
/// \brief Wrapper of type source information for a type with
diff --git a/include/clang/Lex/Token.h b/include/clang/Lex/Token.h
index ef5326909b..bd9b46869a 100644
--- a/include/clang/Lex/Token.h
+++ b/include/clang/Lex/Token.h
@@ -170,7 +170,7 @@ public:
}
void setLiteralData(const char *Ptr) {
assert(isLiteral() && "Cannot set literal data of non-literal");
- PtrData = (void*)Ptr;
+ PtrData = const_cast<char*>(Ptr);
}
void *getAnnotationValue() const {
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 84f6f407cd..07b0c26403 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -2924,7 +2924,8 @@ Sema::OwningExprResult Sema::ActOnPseudoDestructorExpr(Scope *S, ExprArg Base,
// record types and dependent types matter.
void *ObjectTypePtrForLookup = 0;
if (!SS.isSet()) {
- ObjectTypePtrForLookup = (void *)ObjectType->getAs<RecordType>();
+ ObjectTypePtrForLookup = const_cast<RecordType*>(
+ ObjectType->getAs<RecordType>());
if (!ObjectTypePtrForLookup && ObjectType->isDependentType())
ObjectTypePtrForLookup = Context.DependentTy.getAsOpaquePtr();
}