[clang] [Clang] Fix name lookup for dependent bases (PR #114978)

via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 18 05:42:10 PST 2024


================
@@ -170,13 +170,21 @@ bool CXXBasePaths::lookupInBases(ASTContext &Context,
     QualType BaseType =
         Context.getCanonicalType(BaseSpec.getType()).getUnqualifiedType();
 
+    bool isCurrentInstantiation = isa<InjectedClassNameType>(BaseType);
+    if (!isCurrentInstantiation) {
+      if (auto *BaseRecord = cast_or_null<CXXRecordDecl>(
----------------
cor3ntin wrote:

```suggestion
      if (auto *BaseRecord = cast_if_present<CXXRecordDecl>(
```

Can this actually be null?

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


More information about the cfe-commits mailing list