]> granicus.if.org Git - clang/commitdiff
include/clang/AST/APValue.h: Try to fix *900* of cast-qual warnings by g++.
authorNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 10 Nov 2011 10:08:04 +0000 (10:08 +0000)
committerNAKAMURA Takumi <geek4civic@gmail.com>
Thu, 10 Nov 2011 10:08:04 +0000 (10:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144275 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/APValue.h

index 177d7baf4ae2500d7b6a797a68bd3222d9aa3fe0..0d6af425e9afe87ff540d625deffa3aa1a175e1e 100644 (file)
@@ -262,11 +262,11 @@ public:
 
   unsigned getStructNumBases() const {
     assert(isStruct() && "Invalid accessor");
-    return ((StructData*)(char*)Data)->NumBases;
+    return ((const StructData*)(const char*)Data)->NumBases;
   }
   unsigned getStructNumFields() const {
     assert(isStruct() && "Invalid accessor");
-    return ((StructData*)(char*)Data)->NumFields;
+    return ((const StructData*)(const char*)Data)->NumFields;
   }
   APValue &getStructBase(unsigned i) {
     assert(isStruct() && "Invalid accessor");
@@ -285,7 +285,7 @@ public:
 
   const FieldDecl *getUnionField() const {
     assert(isUnion() && "Invalid accessor");
-    return ((UnionData*)(char*)Data)->Field;
+    return ((const UnionData*)(const char*)Data)->Field;
   }
   APValue &getUnionValue() {
     assert(isUnion() && "Invalid accessor");