[Sema] Avoid -Wshadow warnings for shadowed variables that aren't captured
authorAlex Lorenz <arphaman@gmail.com>
Wed, 9 Nov 2016 10:38:57 +0000 (10:38 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Wed, 9 Nov 2016 10:38:57 +0000 (10:38 +0000)
commit175388c00d0a39838a6d61c54ca6256b34e37dab
tree1579faf5c73e50ec8754bd18ae3e44c1d25925f5
parent8339bbd75929ad2d28b4a5a8777bf34f783cc131
[Sema] Avoid -Wshadow warnings for shadowed variables that aren't captured
by lambdas with an explicit capture list

This commit avoids the -Wshadow warning for variables which shadow variables
that aren't captured by lambdas with an explicit capture list. It provides an
additional note that points to location of the explicit capture.

The old behaviour is preserved with -Wshadow-all or -Wshadow-uncaptured-local.

rdar://17135966

Differential Revision: https://reviews.llvm.org/D26278

llvm-svn: 286354
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaDecl.cpp
clang/test/SemaCXX/warn-shadow-in-lambdas.cpp [new file with mode: 0644]