[clangd] Be more explicit on testing the optional DefLoc in LocatedSymbol.
authorHaojian Wu <hokein.wu@gmail.com>
Fri, 31 Jul 2020 12:32:18 +0000 (14:32 +0200)
committerHaojian Wu <hokein.wu@gmail.com>
Fri, 31 Jul 2020 12:34:56 +0000 (14:34 +0200)
commit638f0cf565f2121151c32d7eb52a1de0e333d5f6
tree08fb6edfea63222b76ea25edfcd76140138243f8
parent0d25d3b7e3e3acb86d93acb2291c1d26e056746b
[clangd] Be more explicit on testing the optional DefLoc in LocatedSymbol.

And also fix a bug where we may return a meaningless location.

Differential Revision: https://reviews.llvm.org/D84919
clang-tools-extra/clangd/XRefs.cpp
clang-tools-extra/clangd/unittests/XRefsTests.cpp