The Transaction coming from the TransactionRAII object must be committed after

parser's state has been reverted, because it may induce parsing. This then would
result into an invalid parser state.


git-svn-id: http://root.cern.ch/svn/root/trunk@49120 27541ba8-7e3a-0410-8455-c3a389f83636
This commit is contained in:
Vassil Vassilev 2013-04-08 10:16:01 +00:00
parent 36dedc6eec
commit bfd62ec517
2 changed files with 6 additions and 13 deletions

View File

@ -109,6 +109,12 @@ namespace cling {
Sema& S = P.getActions();
Preprocessor& PP = P.getPreprocessor();
ASTContext& Context = S.getASTContext();
// The user wants to see the template instantiation, existing or not.
// Here we might not have an active transaction to handle
// the caused instantiation decl.
Interpreter::PushTransactionRAII pushedT(m_Interpreter);
ParserStateRAII ResetParserState(P);
prepareForParsing(className.str() + "::",
llvm::StringRef("lookup.class.by.name.file"));
@ -199,15 +205,6 @@ namespace cling {
if (TD) {
TheDecl = TD->getDefinition();
if (!TheDecl && instantiateTemplate) {
// The user wants to see the template instantiation,
// existing or not.
// Here we might not have an active transaction to handle
// the caused instantiation decl.
//FIXME:
// We need it, but it massively breaks roottest. Why?!
// Interpreter::PushTransactionRAII pushedT(m_Interpreter);
// Make sure it is not just forward declared, and
// instantiate any templates.

View File

@ -51,10 +51,6 @@ namespace cling {
return;
}
// FIXME: temporary workaround until r49108 gets fixed.
if (getState() != kCollecting && getState() != kCompleted)
return;
assert(getState() == kCollecting || getState() == kCompleted);
bool checkForWrapper = !m_WrapperFD;
assert(checkForWrapper = true && "Check for wrappers with asserts");