================ @@ -1001,6 +1001,8 @@ void addLayoutInfo(const NamedDecl &ND, HoverInfo &HI) { if (auto *RD = llvm::dyn_cast<RecordDecl>(&ND)) { if (auto Size = Ctx.getTypeSizeInCharsIfKnown(RD->getTypeForDecl())) HI.Size = Size->getQuantity() * 8; + if (!RD->isInvalidDecl() && !RD->isDependentType()) ---------------- zyn0217 wrote:
We already have a check for invalid decl at the beginning of the function: `if (ND.isInvalidDecl()) return;`; Maybe we could avoid this extra check? i.e., `if (!RD->isDependentType())` is enough. https://github.com/llvm/llvm-project/pull/67213 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits