From b3df2f69ff340e2c5c6d215bea6689594f0a3d80 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 15 Dec 2017 16:37:14 +0200 Subject: Remove unnecessary according to Clang lambda captures to suppress warnings Apparently, use of a reference to a global variable need not be captured: https://bugs.llvm.org/show_bug.cgi?id=35669 --- build2/context.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'build2/context.cxx') diff --git a/build2/context.cxx b/build2/context.cxx index c4688be..cfd925b 100644 --- a/build2/context.cxx +++ b/build2/context.cxx @@ -399,9 +399,9 @@ namespace build2 // Create global scope. Note that the empty path is a prefix for any other // path. See the comment in for details. // - auto make_global_scope = [&sm] () -> scope& + auto make_global_scope = [] () -> scope& { - auto i (sm.insert (dir_path (), false)); + auto i (scope_map::instance.insert (dir_path (), false)); scope& r (i->second); r.out_path_ = &i->first; global_scope = scope::global_ = &r; @@ -438,10 +438,10 @@ namespace build2 { const standard_version& v (build_version); - auto set = [&vp, &gs] (const char* var, auto val) + auto set = [&gs] (const char* var, auto val) { using T = decltype (val); - gs.assign (vp.insert (var)) = move (val); + gs.assign (variable_pool::instance.insert (var)) = move (val); }; set ("build.version", v.string_project ()); -- cgit v1.1