[PATCH] D81785: [clangd] Fix readability-else-after-return 'Adding a note without main diagnostic' crash

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Jun 13 03:12:50 PDT 2020


njames93 added a comment.

The actual fix in `ElseAfterReturnCheck.cpp` is needed. 
However clangd's handling of Remarks is a little suspicious. Remarks are supposed to be different to notes in the sense they are designed to be stand alone, unlike notes which depend on a another diagnostic. see Add 'remark' diagnostic type in 'clang' <https://github.com/llvm/llvm-project/commit/741602461d2079c682916bce6701c39acb08bbd3>
This seems to be how clangd determines what a note is:

  bool isNote(DiagnosticsEngine::Level L) {
    return L == DiagnosticsEngine::Note || L == DiagnosticsEngine::Remark;
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81785





More information about the cfe-commits mailing list