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

via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 13 10:15:21 PDT 2026


Serosh-commits wrote:

> I think the better approach would be for error recovery to proceed as if the user didn't write that extraneous qualification.

@mizvekov yup used `setInvalidDecl()` because the qualified friend definition makes the redeclaration chain inconsistent  the friend becomes a `FunctionDecl` but the template expects a `FunctionTemplateDecl` so  ii  marked it invalid and skipped the search to avoid the crash it felt safer to me but yeah i will  try fix it by error recovery method as u said thanks for the feedback 


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


More information about the cfe-commits mailing list