[clang] [clang] Fix cast for injected types in case name lookup for dependent bases (PR #119024)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 9 06:42:07 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())
----------------
erichkeane wrote:

why this instead of:

`Specifier->getType()->getAsCXXRecordDecl()` ??

Same question throughout this patch.

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


More information about the cfe-commits mailing list