]> granicus.if.org Git - clang/commitdiff
fix some more gcc3.4 constness warnings
authorGabor Greif <ggreif@gmail.com>
Thu, 17 Jun 2010 11:29:31 +0000 (11:29 +0000)
committerGabor Greif <ggreif@gmail.com>
Thu, 17 Jun 2010 11:29:31 +0000 (11:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106216 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/TypeLoc.h
include/clang/Lex/Token.h
lib/Sema/SemaExprCXX.cpp

index e043135f2fd5f7106638ad6d356b34e1b0fb5aa8..08b2829f1464a261822da19c121daf28859ccd14 100644 (file)
@@ -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
index ef5326909b25e8da2f8b668c269408f1688da1cb..bd9b46869a35d5d788380c5cd552fd14aa6a2a86 100644 (file)
@@ -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 {
index 84f6f407cd375856d3afb9dae107a29158328ae0..07b0c26403aaa38ff1b230534278ccbb7f82359f 100644 (file)
@@ -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();
   }