[PATCH] D26943: [CodingStandards] Add style guide rule about "if" statements and loops.

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 21 15:39:29 PST 2016


MatzeB added a comment.

In https://reviews.llvm.org/D26943#601961, @compnerd wrote:

> Personally, I think I would prefer that we add braces only if one of the bodies of the code path requires it:


Just for the sake of discussion (I personally would prefer braces). This would result in this in the extreme case:

  if (foo)
    for (Baz b : bazes)
      if (b)
        ++BCount;
      else
        ++NotBCount;
  else
    foobar();


https://reviews.llvm.org/D26943





More information about the llvm-commits mailing list