njames93 marked 8 inline comments as done.
njames93 added inline comments.

================
Comment at: 
clang-tools-extra/test/clang-tidy/checkers/readability-else-after-return.cpp:313
+#endif
+}
----------------
aaron.ballman wrote:
> We should probably add some tests for more pathological cases, like:
> ```
> #if 1
> if (true) {
>   return;
> #else
> {
> #endif
> } else {
>   return;
> }
> ```
I'm don't even think its worth adding tests for that kind of code. Its 
impossible to reason about at the AST level(we dont get any AST for discarded 
pp conditional branches). So for these or cases like :
```lang=c++
if (true) {
#if 1
  return;
} else {
#endif
  return;
}
```
Its just simpler to leave the behaviour as is and hope that a user sees the 
change and addresses (or suppresses) it manually.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91485

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

Reply via email to