This patch 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.
I noticed that we have -Wshadow-all as well, but I wasn't sure how to preserve the old behaviour for it (since I don't think I can check if a diagnostic group is enabled), or if the old behaviour should be preserved at all. What do you think?
This patch fixes PR 21426, but I think that this is a partial fix, since that bug doesn't specify that the capture list should be explicit. I plan on working on a similar patch for lambdas with a default capture specifier and implicit variable captures, but I'm not sure it's 100% needed for them. Do you think this kind of change would make sense for implicit captures as well?
Use the .Text accessor like we do here to avoid repeating the text: