================ @@ -11463,6 +11463,23 @@ void Sema::CheckExplicitObjectMemberFunction(Declarator &D, D.setInvalidType(); } + // Handle the following case: + // + // struct S { + // struct T { + // int f(this T); + // }; + // + // friend int T::f(this T); // Allow this. + // friend int f(this S); // But disallow this. + // }; + if (D.getDeclSpec().isFriendSpecified() && D.getCXXScopeSpec().isEmpty()) { ---------------- Sirraide wrote:
Both of these cases are now diagnosed. https://github.com/llvm/llvm-project/pull/89078 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits