]> granicus.if.org Git - clang/commit
clang-format: Be more aggressive on incorrect code.
authorDaniel Jasper <djasper@google.com>
Fri, 18 Oct 2013 17:20:57 +0000 (17:20 +0000)
committerDaniel Jasper <djasper@google.com>
Fri, 18 Oct 2013 17:20:57 +0000 (17:20 +0000)
commit0baf33b73e2bd6657ee202e2016daf010b8b58b9
treed32a6ecc99e6a537c40a2da69001527edd6840fa
parent49c77b2e702b02a0fbac7b817ccb73e7c128f9d9
clang-format: Be more aggressive on incorrect code.

Before, clang-format would not adjust leading indents if it found a
structural error (e.g. unmatched {}). It seems, however, that
clang-format has gotten good enough at parsing the code structure that
this hurts in almost all cases. Commonly, while writing code, it is
very useful to be able to correclty indent incomplete if statements or
for loops.

In case this leads to errors that we don't anticipate, we need to find
out and fix those.

This fixed llvm.org/PR17594.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192988 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/Format.cpp
unittests/Format/FormatTest.cpp