diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2016-04-29 02:24:14 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2016-04-29 02:24:14 +0000 |
commit | 10aced824a47d3f31dc9ec027808a3ba2a7c98e1 (patch) | |
tree | f0d76ff827bf7162e730595a07cf3820e7942751 /clang/lib/Sema/SemaLambda.cpp | |
parent | 8dafa2da8e334121e7a7e34cb62c304e40da2d6a (diff) | |
download | bcm5719-llvm-10aced824a47d3f31dc9ec027808a3ba2a7c98e1.tar.gz bcm5719-llvm-10aced824a47d3f31dc9ec027808a3ba2a7c98e1.zip |
[Parser] Clear the TemplateParamScope bit of the current scope's flag
if we are parsing a template specialization.
This commit makes changes to clear the TemplateParamScope bit and set
the TemplateParamParent field of the current scope to null if a template
specialization is being parsed.
Before this commit, Sema::ActOnStartOfLambdaDefinition would check
whether the parent template scope had any decls to determine whether
or not a template specialization was being parsed. This wasn't correct
since it couldn't distinguish between a real template specialization and
a template defintion with an unnamed template parameter (only template
parameters with names are added to the scope's decl list). To fix the
bug, this commit changes the code to check the pointer to the parent
template scope rather than the decl list.
rdar://problem/23440346
Differential Revision: http://reviews.llvm.org/D19175
llvm-svn: 267975
Diffstat (limited to 'clang/lib/Sema/SemaLambda.cpp')
-rw-r--r-- | clang/lib/Sema/SemaLambda.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp index 88754e25975..d1d002b5d41 100644 --- a/clang/lib/Sema/SemaLambda.cpp +++ b/clang/lib/Sema/SemaLambda.cpp @@ -814,9 +814,8 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro, // The lambda-expression's closure type might be dependent even if its // semantic context isn't, if it appears within a default argument of a // function template. - if (Scope *TmplScope = CurScope->getTemplateParamParent()) - if (!TmplScope->decl_empty()) - KnownDependent = true; + if (CurScope->getTemplateParamParent()) + KnownDependent = true; // Determine the signature of the call operator. TypeSourceInfo *MethodTyInfo; |