[clang] [Clang]fix dependent qualified base member lookup crash (PR #199403)
via cfe-commits
cfe-commits at lists.llvm.org
Mon May 25 14:30:45 PDT 2026
================
@@ -643,6 +642,8 @@ bool Sema::CheckQualifiedMemberReference(Expr *BaseExpr,
continue;
CXXRecordDecl *MemberRecord = cast<CXXRecordDecl>(DC)->getCanonicalDecl();
+ if (!BaseRecord->hasDefinition() || !MemberRecord->hasDefinition())
+ return false;
----------------
Serosh-commits wrote:
> That's still checking if the record has a definition, so I am not sure what was the point of piping the ASTContext to getBases then?
>
> To be clear, the record has a definition, we just haven't created the representation for it at this point.
>
> It doesn't seem like an obviously correct thing to do here. I'd expect we can either make the definition represented earlier, or have this user moved to after we do.
just being paranoid removed that guard
thanks @mizvekov i have applied the early representation approach
https://github.com/llvm/llvm-project/pull/199403
More information about the cfe-commits
mailing list