summaryrefslogtreecommitdiffstats
path: root/lib/Format/UnwrappedLineParser.cpp
diff options
context:
space:
mode:
authorMarianne Mailhot-Sarrasin <marianne.mailhot.sarrasin@gmail.com>2016-04-14 14:56:49 +0000
committerMarianne Mailhot-Sarrasin <marianne.mailhot.sarrasin@gmail.com>2016-04-14 14:56:49 +0000
commit463ccc6b430b33c924e1d942390c78ee48b2381f (patch)
treefdf43d38aa4acc4808a11213cd9c69445b4a9933 /lib/Format/UnwrappedLineParser.cpp
parent08708dba6769ab21832b9c4a0e8e1d5df2b7377a (diff)
clang-format: Last line in incomplete block is indented incorrectly
Indentation of the last line was reset to the initial indentation of the block when reaching EOF. Patch by Maxime Beaulieu Differential Revision: http://reviews.llvm.org/D19065 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@266321 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/UnwrappedLineParser.cpp')
-rw-r--r--lib/Format/UnwrappedLineParser.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Format/UnwrappedLineParser.cpp b/lib/Format/UnwrappedLineParser.cpp
index 76e87768bc..6cd74f91a8 100644
--- a/lib/Format/UnwrappedLineParser.cpp
+++ b/lib/Format/UnwrappedLineParser.cpp
@@ -430,6 +430,9 @@ void UnwrappedLineParser::parseBlock(bool MustBeDeclaration, bool AddLevel,
++Line->Level;
parseLevel(/*HasOpeningBrace=*/true);
+ if (eof())
+ return;
+
if (MacroBlock ? !FormatTok->is(TT_MacroBlockEnd)
: !FormatTok->is(tok::r_brace)) {
Line->Level = InitialLevel;