From a86bc00d3efa6a92d5f78e052562cc0f8d4b6f6a Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Thu, 16 Feb 2012 21:36:18 +0000 Subject: Lambda closure types are always considered to be like "local" classes, even if they are not within a function scope. Teach template instantiation to treat them as such, and make sure that we have a local instantiation scope when instantiating default arguments and static data members. llvm-svn: 150725 --- clang/lib/Sema/SemaExpr.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Sema/SemaExpr.cpp') diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 6b66a42ad34..5202f96354d 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -3128,6 +3128,7 @@ ExprResult Sema::BuildCXXDefaultArgExpr(SourceLocation CallLoc, // the semantic constraints are checked, at the point where the // default argument expression appears. ContextRAII SavedContext(*this, FD); + LocalInstantiationScope Local(*this); Result = SubstExpr(UninstExpr, ArgList); } if (Result.isInvalid()) -- cgit v1.2.3