diff options
author | Aaron Puchert <aaronpuchert@alice-dsl.net> | 2020-04-22 20:05:36 +0200 |
---|---|---|
committer | Tom Stellard <tstellar@redhat.com> | 2020-05-06 20:08:58 -0700 |
commit | 9c80516d3e3aae34b7dd7ee0204170c888fd7235 (patch) | |
tree | a8f1b66337fdd28931a8b7193512d0eff97fbbeb /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 1d1469ab64294a6a18410310e0f77f590ee4ba7c (diff) | |
download | bcm5719-llvm-9c80516d3e3aae34b7dd7ee0204170c888fd7235.tar.gz bcm5719-llvm-9c80516d3e3aae34b7dd7ee0204170c888fd7235.zip |
PR45000: Let Sema::SubstParmVarDecl handle default args of lambdas in initializers
Summary:
We extend the behavior for local functions and methods of local classes
to lambdas in variable initializers. The initializer is not a separate
scope, but we treat it as such.
We also remove the (faulty) instantiation of default arguments in
TreeTransform::TransformLambdaExpr, because it doesn't do proper
initialization, and if it did, we would do it twice (and thus also emit
eventual errors twice).
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D76038
(cherry picked from commit f43859a099fa3587123717be941fa63ba8d0d4f2)
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rwxr-xr-x | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 37dace3bee7..f801e79c890 100755 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -4367,7 +4367,7 @@ TemplateDeclInstantiator::InitFunctionInstantiation(FunctionDecl *New, EPI.ExceptionSpec.Type != EST_None && EPI.ExceptionSpec.Type != EST_DynamicNone && EPI.ExceptionSpec.Type != EST_BasicNoexcept && - !Tmpl->isLexicallyWithinFunctionOrMethod()) { + !Tmpl->isInLocalScope()) { FunctionDecl *ExceptionSpecTemplate = Tmpl; if (EPI.ExceptionSpec.Type == EST_Uninstantiated) ExceptionSpecTemplate = EPI.ExceptionSpec.SourceTemplate; |