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

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 15 13:15:58 PDT 2026


================
@@ -18461,6 +18408,9 @@ NamedDecl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D,
                                           TemplateParams, AddToScope);
   if (!ND) return nullptr;
 
+  if (WasQualifiedFriendDef)
+    ND->setInvalidDecl();
----------------
mizvekov wrote:

We don't really need to set this, since there is nothing invalid about the declaration now, right?

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


More information about the cfe-commits mailing list