[PATCH] D26125: [clang-tidy] Fixed else-after-return warning in cascade if statement

Paweł Żukowski via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 30 13:01:08 PDT 2016


idlecode added a comment.

@mgehre: Yes it does - in your case AST looks like `ifStmt(b) - CompoundStmt - ifStmt(c)`, so ifStmt's don't have direct parent-child relations.
But there is another problem:

  while(a)
    if (b)
      return 1;
    else
      doSomething(2);

In such case, generated fix (with and without this fix) will change semantics of program.
As @djasper suggested, I need to take a look at this check history and update patch accordingly.


https://reviews.llvm.org/D26125





More information about the cfe-commits mailing list