<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - -Wshadow warns on non captured lambda parameters"
href="http://llvm.org/bugs/show_bug.cgi?id=21426">21426</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>-Wshadow warns on non captured lambda parameters
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.3
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>FreeBSD
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>christof.donat@ppro.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=13261" name="attach_13261" title="C++ code that shows the bug">attachment 13261</a> <a href="attachment.cgi?id=13261&action=edit" title="C++ code that shows the bug">[details]</a></span>
C++ code that shows the bug
Consider the attached code. In this case the parameter argv to main() can not
be considered inside the lambda as a resolution of the name argv, because the
lambda does not capture it. Yet clang++ complains:
------
$ clang++ test.cpp -std=c++11 -Wshadow
test.cpp:16:40: warning: declaration shadows a local variable [-Wshadow]
concat_params([](int i, const char** argv) -> std::string {
return argv[i]; }, argc, argv) <<
^
test.cpp:13:34: note: previous declaration is here
auto main(int argc, const char** argv) -> int
^
1 warning generated.
$
------
For details:
------
$ clang++ --version
FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
Target: x86_64-unknown-freebsd10.0
Thread model: posix
$
------</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>