summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/Parser.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2013-10-23 21:31:20 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2013-10-23 21:31:20 +0000
commitc85ed7e4a2a1f42a07e4940f38d7f365b662a1af (patch)
treeea604000f6718b9e700fe0f169422c4e9518ae93 /clang/lib/Parse/Parser.cpp
parenta5ffd3f9940c8f80691df6451a811301cafd25a8 (diff)
downloadbcm5719-llvm-c85ed7e4a2a1f42a07e4940f38d7f365b662a1af.tar.gz
bcm5719-llvm-c85ed7e4a2a1f42a07e4940f38d7f365b662a1af.zip
Parse: Disable delayed template parsing for constexpr functions
Commit r191484 treated constexpr function templates as normal function templates with respect to delaying their parsing. However, this is unnecessarily restrictive because there is no compatibility concern with constexpr, MSVC doesn't support it. Instead, simply disable delayed template parsing for constexpr function templates. This largely reverts the changes made in r191484 but keeps it's unit test. This fixes PR17661. llvm-svn: 193274
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r--clang/lib/Parse/Parser.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index 9b6c97ac195..d95546af8ab 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -990,9 +990,9 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &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.
- if (getLangOpts().DelayedTemplateParsing &&
- Tok.isNot(tok::equal) &&
- TemplateInfo.Kind == ParsedTemplateInfo::Template) {
+ if (getLangOpts().DelayedTemplateParsing && Tok.isNot(tok::equal) &&
+ TemplateInfo.Kind == ParsedTemplateInfo::Template &&
+ !D.getDeclSpec().isConstexprSpecified()) {
MultiTemplateParamsArg TemplateParameterLists(*TemplateInfo.TemplateParams);
ParseScope BodyScope(this, Scope::FnScope|Scope::DeclScope);
OpenPOWER on IntegriCloud