diff --git a/core/meta/src/TClingCallbacks.cxx b/core/meta/src/TClingCallbacks.cxx index 594397d2bf80734f50ec816e24f55acec4fa8ffe..5140451051f02287bea03498921c775ce9ddbe1d 100644 --- a/core/meta/src/TClingCallbacks.cxx +++ b/core/meta/src/TClingCallbacks.cxx @@ -294,7 +294,15 @@ bool TClingCallbacks::tryAutoloadInternal(llvm::StringRef Name, LookupResult &R, // 'neutral' token, this will force clang to create the so called in // C++11 EmptyDecl. It is not a big issue, but still suboptimal. cling::Transaction* T = 0; - m_Interpreter->declare("namespace " + Name.str() + "{}", &T); + // For now rely on a side effect in cling. When there was an error + // all subsequent transaction coming from the autoloading will be + // unsuccessful, because cling is on the error path, before trying + // to recover. + // FIXME: In future that might change so heads up. + cling::Interpreter::CompilationResult CR + = m_Interpreter->declare("namespace " + Name.str() + "{}", &T); + if (CR == cling::Interpreter::kFailure) + return false; pushedDCAndS.pop(); cleanupRAII.pop(); // The first decl in T will be EmptyDecl unless the FIXME above gets