[PATCH] D26448: Avoid -Wshadow warnings for shadowed variables that aren't captured by lambdas with a default capture specifier

Alex Lorenz via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 9 04:43:23 PST 2016


arphaman created this revision.
arphaman added reviewers: rnk, rsmith.
arphaman added a subscriber: cfe-commits.
arphaman set the repository for this revision to rL LLVM.

This is a follow-up patch to r286354. This patch avoids the -Wshadow warning for variables which shadow variables that aren't captured by lambdas with a default capture specifier. It provides an additional note that points to location of the capture.

The old behaviour is preserved with -Wshadow-all.

This fixes PR 21426 fully.


Repository:
  rL LLVM

https://reviews.llvm.org/D26448

Files:
  include/clang/Basic/DiagnosticSemaKinds.td
  include/clang/Sema/ScopeInfo.h
  include/clang/Sema/Sema.h
  lib/Sema/SemaDecl.cpp
  lib/Sema/SemaLambda.cpp
  test/SemaCXX/warn-shadow-in-lambdas.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26448.77335.patch
Type: text/x-patch
Size: 9899 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161109/7b99b5a6/attachment.bin>


More information about the cfe-commits mailing list