From e4ddc63e15de6f585288810976d4d0adf7625c87 Mon Sep 17 00:00:00 2001 From: Mariya Podchishchaeva Date: Mon, 12 Feb 2024 12:44:20 +0300 Subject: [PATCH] [clang] Avoid -Wshadow warning when init-capture named same as class field (#74512) Shadowing warning doesn't make much sense since field is not available in lambda's body without capturing this. Fixes https://github.com/llvm/llvm-project/issues/71976 --- clang/docs/ReleaseNotes.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index b69e7ae4451f1c3..6f9652e31d0b8cd 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -929,6 +929,9 @@ Bug Fixes in This Version - Clang now doesn't produce false-positive warning `-Wconstant-logical-operand` for logical operators in C23. Fixes (`#64356 `_). +- Clang's ``-Wshadow`` no longer warns when an init-capture is named the same as + a class field unless the lambda can capture this. + Fixes (`#71976 `_) Bug Fixes to Compiler Builtins ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^