Issue 235298
Summary [clang-tidy][false-positive] `readability-else-after-return` warns even when `else` branch uses init statement value
Labels clang-tidy, false-positive
Assignees
Reporter tearfur
    https://godbolt.org/z/8h78rh74W

```
<source>:6:7: warning: do not use 'else' after 'return' [readability-else-after-return]
 4 |     if (auto const len = strlen(argv[0]); len == 0) {
      |     ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    5 |         return 1;
    6 |     } else {
      |       ^~~~~~
    7 |         (void)len; // Use `len` for something
    8 |     }
      |     ~
```

Current trunk: 44c618a4425eb8b83bf2f35df5e9d573c12a65d0
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to