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

via Openmp-commits openmp-commits at lists.llvm.org
Thu Jan 11 08:17:47 PST 2024


cor3ntin wrote:

@philnik777 I agree strongly with @Fznamznon.
If `this` is not captured there is no actual shadowing in that they do not occupy encompassing scope, and so removing one declaration would not give you access to the other variable. 

> Should we still emit shadowing warning in case lambda captured this and has an init-capture with the same name as a class field?

Yes, we should probably do that.

(sorry for the very delayed reply, it fell off my radar)

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


More information about the Openmp-commits mailing list