From d1112e3ce5069b45ec83bfa3188206fb78bfc285 Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Sun, 11 Nov 2012 12:53:21 +0000 Subject: [PATCH] Get the result type directly from the wrapper function's return type. Do that *after* the tranformers have done their work; they change the result type. Silence a "return 12" inside a (not yet transformed) void wrapper(). The return type will later be repaired by the ReturnSynthesizer if needed. git-svn-id: http://root.cern.ch/svn/root/trunk@47165 27541ba8-7e3a-0410-8455-c3a389f83636 --- lib/Interpreter/Interpreter.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/Interpreter/Interpreter.cpp b/lib/Interpreter/Interpreter.cpp index d87778dd..90ff3c0b 100644 --- a/lib/Interpreter/Interpreter.cpp +++ b/lib/Interpreter/Interpreter.cpp @@ -557,14 +557,9 @@ namespace cling { Transaction* CurT = m_IncrParser->Parse(Wrapper, CO); assert(CurT->size() && "No decls created by Parse!"); - if (Expr* E = utils::Analyze::GetOrCreateLastExpr(CurT->getWrapperFD(), - /*foundAt*/0, - /*omitDS*/false, - &getSema())) { - resTy = E->getType(); - } + m_IncrParser->commitCurrentTransaction(); // might change resTy - m_IncrParser->commitCurrentTransaction(); + resTy = CurT->getWrapperFD()->getResultType(); } else m_IncrParser->Compile(Wrapper, CO); @@ -698,7 +693,8 @@ namespace cling { clang::diag::MAP_IGNORE, SourceLocation()); Diag.setDiagnosticMapping(clang::diag::warn_unused_comparison, clang::diag::MAP_IGNORE, SourceLocation()); - + Diag.setDiagnosticMapping(clang::diag::ext_return_has_expr, + clang::diag::MAP_IGNORE, SourceLocation()); } bool Interpreter::addSymbol(const char* symbolName, void* symbolAddress) {