http://llvm.org/bugs/show_bug.cgi?id=21426

            Bug ID: 21426
           Summary: -Wshadow warns on non captured lambda parameters
           Product: clang
           Version: 3.3
          Hardware: PC
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

Created attachment 13261
  --> http://llvm.org/bugs/attachment.cgi?id=13261&action=edit
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
$
------

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to