================ @@ -265,8 +268,8 @@ bool CXXBasePaths::lookupInBases(ASTContext &Context, BaseRecord = nullptr; } } else { - BaseRecord = cast<CXXRecordDecl>( - BaseSpec.getType()->castAs<RecordType>()->getDecl()); + if (auto *RT = BaseSpec.getType()->getAs<RecordType>()) + BaseRecord = cast<CXXRecordDecl>(RT->getDecl()); ---------------- vbe-sc wrote:
This is almost same. To be correct, we need to replace the first variant with ```c++ BaseRecord = cast<CXXRecordDecl>(BaseSpec.getType()->getAsRecordDecl()); ``` All in all, thanks for this comment. Fixed https://github.com/llvm/llvm-project/pull/114978 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits