[clang] [clang] fix crash in friend definition (PR #186398)

via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 15 14:26:36 PDT 2026


Serosh-commits wrote:

@mizvekov using SS.clear() and Previous.clear() stops the crash but it breaks some existing tests i think the reason is that it runs for all using SS.clear() and Previous.clear() stops the crash but it breaks some existing tests i think the reason is that it runs for all qualified friend definitions, including cases like friend void C::f() inside a class, which should produce a different diagnostic so i am kinda  thinking maybe the recovery should run only when the qualifier refers to namespace/global scope, which we can check using computeDeclContext(SS) will that would be a good approach ?

https://github.com/llvm/llvm-project/pull/186398


More information about the cfe-commits mailing list