[libcxx-commits] [libcxx] [flang] [openmp] [clang-tools-extra] [libcxxabi] [clang] [llvm] [compiler-rt] [libc] [mlir] [clang] Avoid -Wshadow warning when init-capture named same as class field (PR #74512)

Mariya Podchishchaeva via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jan 11 09:41:55 PST 2024


Fznamznon wrote:

> It looks like Clang even has a warning for this specific case and GCC considers it shadowing too: https://godbolt.org/z/Y16njoPxh, which makes me think that people want this - at least as a separate flag.

I already came across `-Wshadow-uncaptured-local` flag earlier - https://github.com/llvm/llvm-project/issues/71976#issuecomment-1840927162 . I don't mind putting the warning that I'm avoiding with the current patch under this flag as well.

https://github.com/llvm/llvm-project/pull/74512


More information about the libcxx-commits mailing list