diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2016-12-16 03:19:41 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2016-12-16 03:19:41 +0000 |
commit | 05ba9f09f57ba3730d58b2f91030e1000c1232fd (patch) | |
tree | ba8881104651da8c8f0ee4eb67833c564a0d817c /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | f6a2fba0e5824dc6c2c3c7ec25bfb8ca25d8571f (diff) |
[Sema] Fix handling of enumerators used as default arguments of lambda
expressions in a function or class template.
This patch makes the following changes:
- Create a DependentScopeDeclRefExpr for the default argument instead of
a CXXDependentScopeMemberExpr.
- Pass CombineWithOuterScope=true so that the outer scope in which the
enum is declared is searched for the instantiation of the enum.
This is the first part of https://reviews.llvm.org/D23096. Fixes PR28795
rdar://problem/27535319
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289914 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index 321fd6995b..4e3862a14d 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -1687,7 +1687,7 @@ ParmVarDecl *Sema::SubstParmVarDecl(ParmVarDecl *OldParm, // Instantiate default arguments for methods of local classes (DR1484) // and non-defining declarations. Sema::ContextRAII SavedContext(*this, OwningFunc); - LocalInstantiationScope Local(*this); + LocalInstantiationScope Local(*this, true); ExprResult NewArg = SubstExpr(Arg, TemplateArgs); if (NewArg.isUsable()) { // It would be nice if we still had this. |