kadircet added a comment. thanks for doing this !
================ Comment at: clang-tools-extra/clangd/Hover.cpp:665 if (auto *RD = llvm::dyn_cast<RecordDecl>(&ND)) { if (auto Size = Ctx.getTypeSizeInCharsIfKnown(RD->getTypeForDecl())) HI.Size = Size->getQuantity(); ---------------- i think we should bail out for invalid decls in here too. it won't crash but will provide spurious results. so i think an early exit for `ND.isInvalidDecl()` at the beginning of the function would be nice. ================ Comment at: clang-tools-extra/clangd/Hover.cpp:677 HI.Size = Size->getQuantity(); - if (!FD->isInvalidDecl()) HI.Offset = Ctx.getFieldOffset(FD) / 8; + } ---------------- could you move this out of the if statement. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83189/new/ https://reviews.llvm.org/D83189 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits