[clang] [Clang]fix dependent qualified base member lookup crash (PR #199403)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Mon May 25 08:13:28 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;
----------------
mizvekov 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.
https://github.com/llvm/llvm-project/pull/199403
More information about the cfe-commits
mailing list