]> granicus.if.org Git - clang/commitdiff
Fix Cast
authorDavid Greene <greened@obbligato.org>
Tue, 15 Jan 2013 22:09:40 +0000 (22:09 +0000)
committerDavid Greene <greened@obbligato.org>
Tue, 15 Jan 2013 22:09:40 +0000 (22:09 +0000)
Avoid a cast-away-const error by properly using const_cast<>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172558 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/CXXInheritance.cpp

index 5083a010e1ee5d5507b797c4e0b2589317a363e6..0e0b35d92adfb2d9af9ba1b0e5e8593721982944 100644 (file)
@@ -118,7 +118,8 @@ static bool BaseIsNot(const CXXRecordDecl *Base, void *OpaqueTarget) {
 }
 
 bool CXXRecordDecl::isProvablyNotDerivedFrom(const CXXRecordDecl *Base) const {
-  return forallBases(BaseIsNot, (void*) Base->getCanonicalDecl());
+  return forallBases(BaseIsNot,
+                     const_cast<CXXRecordDecl *>(Base->getCanonicalDecl()));
 }
 
 bool