diff --git a/clang/tools/libclang/IndexingContext.cpp b/clang/tools/libclang/IndexingContext.cpp index 2e69c4684948..059d84251598 100644 --- a/clang/tools/libclang/IndexingContext.cpp +++ b/clang/tools/libclang/IndexingContext.cpp @@ -646,6 +646,19 @@ bool IndexingContext::handleCXXRecordDecl(const CXXRecordDecl *RD, CXXDInfo.CXXClassInfo.bases = BaseList.getBases(); CXXDInfo.CXXClassInfo.numBases = BaseList.getNumBases(); + if (suppressRefs()) { + // Go through bases and mark them as referenced. + for (unsigned i = 0, e = BaseList.getNumBases(); i != e; ++i) { + const CXIdxBaseClassInfo *baseInfo = BaseList.getBases()[i]; + if (baseInfo->base) { + const NamedDecl *BaseD = BaseList.BaseEntities[i].Dcl; + SourceLocation + Loc = SourceLocation::getFromRawEncoding(baseInfo->loc.int_data); + markEntityOccurrenceInFile(BaseD, Loc); + } + } + } + return handleDecl(OrigD, OrigD->getLocation(), getCursor(OrigD), CXXDInfo); }