================
@@ -8566,8 +8580,10 @@ void Sema::DiagnoseShadowingLambdaDecls(const
LambdaScopeInfo *LSI) {
const NamedDecl *ShadowedDecl = Shadow.ShadowedDecl;
// Try to avoid the warning when the shadowed decl isn't captured.
const DeclContext *OldDC = ShadowedDecl->getDeclContext();
- if (const auto *VD = dyn_cast<VarDecl>(ShadowedDecl)) {
+ if (isa<VarDecl, BindingDecl>(ShadowedDecl)) {
+ const auto *VD = cast<ValueDecl>(ShadowedDecl);
SourceLocation CaptureLoc = getCaptureLocation(LSI, VD);
+
----------------
Fznamznon wrote:
```suggestion
```
https://github.com/llvm/llvm-project/pull/157667
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits