================
@@ -8508,10 +8525,17 @@ void Sema::CheckShadow(NamedDecl *D, NamedDecl 
*ShadowedDecl,
           return;
         }
       }
-      if (const auto *VD = dyn_cast<VarDecl>(ShadowedDecl);
-          VD && VD->hasLocalStorage()) {
-        // A variable can't shadow a local variable in an enclosing scope, if
-        // they are separated by a non-capturing declaration context.
+      // Apply scoping logic to both VarDecl and BindingDecl
+      bool shouldApplyScopingLogic = false;
+      if (const auto *VD = dyn_cast<VarDecl>(ShadowedDecl)) {
+        shouldApplyScopingLogic = VD->hasLocalStorage();
----------------
ivanmurashko wrote:

Addressed at 578e61b7aebbfa9213a28f3dabd29708112ce2a5 (also changed local vars 
names according the coding style)

https://github.com/llvm/llvm-project/pull/157667
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to