From ada887e6d12918980afd5cbc1b5bf3810491b4dc Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Fri, 12 Sep 2014 14:12:16 +0200 Subject: [PATCH] Adapt to new const-ness. --- core/metautils/src/TMetaUtils.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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; } -- 1.8.2