[clang] [Clang] Fix name lookup for dependent bases (PR #114978)
Vladislav Belov via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 7 01:10:01 PST 2024
================
@@ -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
More information about the cfe-commits
mailing list