diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2016-06-15 11:24:54 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2016-06-15 11:24:54 +0000 |
commit | 61deb4dadc1682c044e1c3910ec45d36d9452fba (patch) | |
tree | 920d3e3d671cb73f19a5e39c096a2333858313b9 /clang/lib/Parse/Parser.cpp | |
parent | b46cdeae9f5e94b12ca321e91ddef0974440222e (diff) | |
download | bcm5719-llvm-61deb4dadc1682c044e1c3910ec45d36d9452fba.tar.gz bcm5719-llvm-61deb4dadc1682c044e1c3910ec45d36d9452fba.zip |
Revert accidential "[MSVC] Late parsing of in-class defined member functions in template"
This reverts commit 0253605771b8bd9d414aba74fe2742c730d6fd1a.
llvm-svn: 272776
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r-- | clang/lib/Parse/Parser.cpp | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index b8f68c03bd4..9ed2d72fcd9 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -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(); |