hokein added a comment.

In D135257#3836511 <https://reviews.llvm.org/D135257#3836511>, @ilya-biryukov 
wrote:

> Having `nullptr` inside `children()` seems really weird. Should we fix those 
> instead to never produce `nullptr`? Or is this something that is expected (I 
> can come up with a few contracts where this would make sense, but that all 
> looks really akward).

I'm not too surprised to see this, given the code action is widely triggered 
(on broken code). It would be nice that clang never produce a nullptr, but 
we're not in a perfect world. And there are other places (e.g. 
<https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaExceptionSpec.cpp#L998>)
 in the code base doing this nullptr check. So to me, this patch is an 
improvement making clangd more robust, it looks good from my side.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135257

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

Reply via email to