[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
Tue Jun 16 04:25:16 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG740575dc232b: [clangd] Fix readability-else-after-return 'Adding a note without main… (authored by njames93).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81785

Files:
  clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp


Index: clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp
===================================================================
--- clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp
+++ clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp
@@ -188,9 +188,8 @@
     if (IsLastInScope) {
       // If the if statement is the last statement its enclosing statements
       // scope, we can pull the decl out of the if statement.
-      DiagnosticBuilder Diag =
-          diag(ElseLoc, WarningMessage, clang::DiagnosticIDs::Level::Remark)
-          << ControlFlowInterruptor;
+      DiagnosticBuilder Diag = diag(ElseLoc, WarningMessage)
+                               << ControlFlowInterruptor;
       if (checkInitDeclUsageInElse(If) != nullptr) {
         Diag << tooling::fixit::createReplacement(
                     SourceRange(If->getIfLoc()),


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81785.271042.patch
Type: text/x-patch
Size: 892 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200616/bb13ec47/attachment.bin>


More information about the cfe-commits mailing list