================
@@ -8264,11 +8264,14 @@ void Sema::CheckShadow(NamedDecl *D, NamedDecl
*ShadowedDecl,
DeclContext *NewDC = D->getDeclContext();
if (FieldDecl *FD = dyn_cast<FieldDecl>(ShadowedDecl)) {
- // Fields are not shadowed by variables in C++ static methods.
- if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(NewDC))
+ if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(NewDC)) {
+ // Fields are not shadowed by variables in C++ static methods.
if (MD->isStatic())
return;
+ if (!MD->getType().isNull() && MD->isExplicitObjectMemberFunction())
----------------
Sirraide wrote:
Alternatively, we also have `isLambdaCallWithExplicitObjectParameter()`, which
is a free function in the `clang` namespace that we could maybe use here.
https://github.com/llvm/llvm-project/pull/114813
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits