[clang] [clang] Fix cast for injected types in case name lookup for dependent bases (PR #119024)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Dec 7 08:02:38 PST 2024
================
@@ -368,8 +368,8 @@ bool CXXRecordDecl::FindBaseClass(const CXXBaseSpecifier *Specifier,
const CXXRecordDecl *BaseRecord) {
assert(BaseRecord->getCanonicalDecl() == BaseRecord &&
"User data for FindBaseClass is not canonical!");
- return Specifier->getType()->castAs<RecordType>()->getDecl()
- ->getCanonicalDecl() == BaseRecord;
+ return (cast<CXXRecordDecl>(Specifier->getType()->getAsRecordDecl())
+ ->getCanonicalDecl()) == BaseRecord;
----------------
cor3ntin wrote:
You do not need the outer parentheses here
https://github.com/llvm/llvm-project/pull/119024
More information about the cfe-commits
mailing list