Revert accidential "[MSVC] Late parsing of in-class defined member functions in template"
This reverts commit 0253605771b8bd9d414aba74fe2742c730d6fd1a. llvm-svn: 272776
This commit is contained in:
@@ -89,8 +89,6 @@ Parser::Parser(Preprocessor &pp, Sema &actions, bool skipFunctionBodies)
|
||||
PP.addCommentHandler(CommentSemaHandler.get());
|
||||
|
||||
PP.setCodeCompletionHandler(*this);
|
||||
if (getLangOpts().MSVCCompat)
|
||||
Actions.SetLateTemplateParser(LateTemplateParserCallback, nullptr, this);
|
||||
}
|
||||
|
||||
DiagnosticBuilder Parser::Diag(SourceLocation Loc, unsigned DiagID) {
|
||||
@@ -1055,35 +1053,12 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D,
|
||||
Actions.MarkAsLateParsedTemplate(FnD, DP, Toks);
|
||||
}
|
||||
return DP;
|
||||
} else if (getLangOpts().MSVCCompat && Tok.isNot(tok::equal) &&
|
||||
TemplateInfo.Kind == ParsedTemplateInfo::Template &&
|
||||
Actions.canDelayFunctionBody(D)) {
|
||||
// In delayed template parsing mode, for function template we consume the
|
||||
// tokens and store them for late parsing at the end of the translation
|
||||
// unit.
|
||||
MultiTemplateParamsArg TemplateParameterLists(*TemplateInfo.TemplateParams);
|
||||
|
||||
ParseScope BodyScope(this, Scope::FnScope | Scope::DeclScope);
|
||||
|
||||
CachedTokens Toks;
|
||||
LexTemplateFunctionForLateParsing(Toks);
|
||||
|
||||
Decl *Res = Actions.ActOnStartOfFunctionDef(getCurScope(), D,
|
||||
*TemplateInfo.TemplateParams);
|
||||
D.complete(Res);
|
||||
D.getMutableDeclSpec().abort();
|
||||
StmtResult Body = Actions.ActOnMSLateParsedCompoundStmt(
|
||||
Toks.begin()->getLocation(), Tok.getLocation(), Toks,
|
||||
Lexer::getSourceText(
|
||||
{{Toks.begin()->getLocation(), Tok.getLocation()}, false},
|
||||
Actions.getASTContext().getSourceManager(), getLangOpts()));
|
||||
BodyScope.Exit();
|
||||
|
||||
return Actions.ActOnFinishFunctionBody(Res, Body.get());
|
||||
} else if (CurParsedObjCImpl && !TemplateInfo.TemplateParams &&
|
||||
(Tok.is(tok::l_brace) || Tok.is(tok::kw_try) ||
|
||||
Tok.is(tok::colon)) &&
|
||||
Actions.CurContext->isTranslationUnit()) {
|
||||
}
|
||||
else if (CurParsedObjCImpl &&
|
||||
!TemplateInfo.TemplateParams &&
|
||||
(Tok.is(tok::l_brace) || Tok.is(tok::kw_try) ||
|
||||
Tok.is(tok::colon)) &&
|
||||
Actions.CurContext->isTranslationUnit()) {
|
||||
ParseScope BodyScope(this, Scope::FnScope|Scope::DeclScope);
|
||||
Scope *ParentScope = getCurScope()->getParent();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user