[llvm-bugs] [Bug 35669] New: bogus lambda capture is not required warnings [-Wunused-lambda-capture]
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Dec 15 05:50:42 PST 2017
https://bugs.llvm.org/show_bug.cgi?id=35669
Bug ID: 35669
Summary: bogus lambda capture is not required warnings
[-Wunused-lambda-capture]
Product: clang
Version: 5.0
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++11
Assignee: unassignedclangbugs at nondot.org
Reporter: boris at codesynthesis.com
CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
The following two cases trigger bogus warnings:
auto& sm (scope_map::instance);
auto make_global_scope = [&sm] () -> scope&
{
auto i (sm.insert (dir_path (), false));
scope& r (i->second);
r.out_path_ = &i->first;
global_scope = scope::global_ = &r;
return r;
};
warning: lambda capture 'sm' is not required to be captured for this use
[-Wunused-lambda-capture]
auto& vp (variable_pool::instance);
auto set = [&vp, &gs] (const char* var, auto val)
{
using T = decltype (val);
gs.assign (vp.insert<T> (var)) = move (val);
};
warning: lambda capture 'vp' is not required to be captured for this use
[-Wunused-lambda-capture]
Both sm and vp are references to global variables. For the complete build log,
see:
https://stage.build2.org/?builds=&pn=build2&cf=linux-clang_5.0
The same problem exists in trunk at the time of this report.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20171215/eda5c643/attachment.html>
More information about the llvm-bugs
mailing list