Remove a const_cast by propagating constness to called functions


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175161 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp
index 738e31a..e145d3f 100644
--- a/lib/Sema/SemaCodeComplete.cpp
+++ b/lib/Sema/SemaCodeComplete.cpp
@@ -315,7 +315,7 @@
     void ExitScope();
     
     /// \brief Ignore this declaration, if it is seen again.
-    void Ignore(Decl *D) { AllDeclsFound.insert(D->getCanonicalDecl()); }
+    void Ignore(const Decl *D) { AllDeclsFound.insert(D->getCanonicalDecl()); }
 
     /// \name Name lookup predicates
     ///
@@ -3094,7 +3094,7 @@
        M != MEnd; ++M) {
     CodeCompletionBuilder Builder(Results.getAllocator(),
                                   Results.getCodeCompletionTUInfo());
-    CXXMethodDecl *Overridden = const_cast<CXXMethodDecl *>(*M);
+    const CXXMethodDecl *Overridden = *M;
     if (Overridden->getCanonicalDecl() == Method->getCanonicalDecl())
       continue;