[PATCH] D101743: [clangd] Fix hover crash on broken code

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 4 01:56:19 PDT 2021


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/unittests/HoverTests.cpp:2447
+    // Setter variable heuristic might fail if the callexpr is broken.
+    struct X { int Y; void [[^setY]](float) { Y = foo(x); } };)cpp");
+
----------------
hokein wrote:
> IIUC, x refers to an undefined variable right? might be renamed it to `undefine`.
> 
> Instead of creating a new test, maybe add this no-crash test to `TEST(Hover, NoHover) {`, looks like a good fit there.
> IIUC, x refers to an undefined variable right? might be renamed it to undefine.

Done.

> Instead of creating a new test, maybe add this no-crash test to TEST(Hover, NoHover) {, looks like a good fit there.

This produces a hover though. I think we should collect all the cases about crash-ness here, independent of whether they produce a hover or not.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101743



More information about the cfe-commits mailing list