[PATCH] D21279: Fix some issues in clang-format's AlignConsecutive modes

Beren Minor via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 13 12:08:38 PDT 2016


berenm added a comment.

There's still cases where the nesting level is still not correctly handled: when using unbraced conditionals / loops. For example (sorry, silly example):

  for (auto index = 0, e = 1000; index < e; ++index)
    int v = 0;
  long double value = 1;

is aligned to

  for (auto index = 0, e = 1000; index < e; ++index)
    int       v     = 0;
  long double value = 1;

I'm not sure how to detect these unbraced scopes, maybe by also looking for different IndentLevel when computing the ScopeLevel?


http://reviews.llvm.org/D21279





More information about the cfe-commits mailing list