kadircet accepted this revision.
kadircet added a comment.
This revision is now accepted and ready to land.

thanks!



================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:664
   bool VisitCXXMemberCallExpr(CXXMemberCallExpr *CE) {
-    if (isa<CXXDestructorDecl>(CE->getMethodDecl())) {
+    if (isa_and_nonnull<CXXDestructorDecl>(CE->getMethodDecl())) {
       if (auto *ME = dyn_cast<MemberExpr>(CE->getCallee())) {
----------------
can you add a comment here saying `getMethodDecl can return nullptr with member 
pointers`.

(it's also quite surprising that this is the only place we're calling 
getMethodDecl in clangd, afaict).


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:664
   bool VisitCXXMemberCallExpr(CXXMemberCallExpr *CE) {
-    if (isa<CXXDestructorDecl>(CE->getMethodDecl())) {
+    if (isa_and_nonnull<CXXDestructorDecl>(CE->getMethodDecl())) {
       if (auto *ME = dyn_cast<MemberExpr>(CE->getCallee())) {
----------------
kadircet wrote:
> can you add a comment here saying `getMethodDecl can return nullptr with 
> member pointers`.
> 
> (it's also quite surprising that this is the only place we're calling 
> getMethodDecl in clangd, afaict).
nit: `isa_and_present` is the new alternative


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137064/new/

https://reviews.llvm.org/D137064

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to