From: Axel Naumann Date: Fri, 12 Sep 2014 12:12:16 +0000 (+0200) Subject: Adapt to new const-ness. X-Git-Tag: v6-02-00-rc1~128^2~5 X-Git-Url: https://root.cern.ch/gitweb?p=root.git;a=commitdiff_plain;h=ada887e6d12918980afd5cbc1b5bf3810491b4dc Adapt to new const-ness. --- diff --git a/core/metautils/src/TMetaUtils.cxx b/core/metautils/src/TMetaUtils.cxx index 33bb8e3..b598a47 100644 --- a/core/metautils/src/TMetaUtils.cxx +++ b/core/metautils/src/TMetaUtils.cxx @@ -620,7 +620,7 @@ inline bool IsTemplate(const clang::Decl &cl) const clang::FunctionDecl* ROOT::TMetaUtils::ClassInfo__HasMethod(const clang::DeclContext *cl, const char* name, const cling::Interpreter& interp) { - clang::Sema* S = const_cast(&interp.getSema()); + clang::Sema* S = &interp.getSema(); const clang::NamedDecl* ND = cling::utils::Lookup::Named(S, name, cl); if (ND == (clang::NamedDecl*)-1) return (clang::FunctionDecl*)-1; @@ -4592,9 +4592,7 @@ static void addDeclToTransaction(clang::Decl *decl, const std::string ROOT::TMetaUtils::AST2SourceTools::Decls2FwdDecls(const std::vector &decls, const cling::Interpreter &interp) { - // Ugly const removal: wrong cling interfaces - cling::Interpreter *ncInterp = const_cast(&interp); - clang::Sema &sema = ncInterp->getSema(); + clang::Sema &sema = interp.getSema(); cling::Transaction theTransaction(sema); std::set addedDecls; for (auto decl : decls) { @@ -4604,7 +4602,7 @@ const std::string ROOT::TMetaUtils::AST2SourceTools::Decls2FwdDecls(const std::v } std::string newFwdDecl; llvm::raw_string_ostream llvmOstr(newFwdDecl); - ncInterp->forwardDeclare(theTransaction, sema.getSourceManager(), llvmOstr, true, nullptr); + interp.forwardDeclare(theTransaction, sema.getSourceManager(), llvmOstr, true, nullptr); llvmOstr.flush(); return newFwdDecl; }