ilya-biryukov added a comment.

Do we care about pointers or references to lambda types?



================
Comment at: clang-tools-extra/clangd/XRefs.cpp:662
+      if (const DecltypeType *DT =
+              llvm::dyn_cast<DecltypeType>(VD->getType().getTypePtr()))
+        if (!DT->getUnderlyingType().isNull())
----------------
Variable types can be null (for C++17 deconstruction syntax), use 
`getTypePtrOrNull`.


================
Comment at: clang-tools-extra/clangd/XRefs.cpp:664
+        if (!DT->getUnderlyingType().isNull())
+          if (const auto *CD = DT->getUnderlyingType()->getAsCXXRecordDecl())
+            return CD->getLambdaCallOperator();
----------------
NIT: add extra braces to the inner `if` for more readable code


================
Comment at: clang-tools-extra/clangd/XRefs.cpp:669
+      if (const Expr *E = VD->getInit())
+        if (const LambdaExpr *LE = llvm::dyn_cast<LambdaExpr>(E))
+          return LE->getCallOperator();
----------------
NIT: add extra braces to the inner `if` for more readable code


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D62814



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

Reply via email to