================ @@ -0,0 +1,13 @@ +// RUN: %clang_cc1 -verify -fsyntax-only -std=c++2b -Wshadow-all %s + +namespace GH95707 { +struct Foo { + int a; // expected-note {{previous declaration is here}} + + void f1(this auto &self, int a) { self.a = a; } + void f2(int a) { } // expected-warning {{declaration shadows a field of 'GH95707::Foo'}} + void f3() { + (void)[&](this auto &self, int a) { }; ---------------- Sirraide wrote:
Ok, the test is correct now, but here we have a problem: The `a` parameter shadows the struct member, but it isn’t diagnosed—to be fair, we don’t currently diagnose that either, but it would be nice to do so. I think we do have to check if the `CXXMethodDecl` is a lambda call operator. https://github.com/llvm/llvm-project/pull/114813 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits