diff options
author | Marianne Mailhot-Sarrasin <marianne.mailhot.sarrasin@gmail.com> | 2016-04-14 14:56:49 +0000 |
---|---|---|
committer | Marianne Mailhot-Sarrasin <marianne.mailhot.sarrasin@gmail.com> | 2016-04-14 14:56:49 +0000 |
commit | 463ccc6b430b33c924e1d942390c78ee48b2381f (patch) | |
tree | fdf43d38aa4acc4808a11213cd9c69445b4a9933 /lib/Format/UnwrappedLineParser.cpp | |
parent | 08708dba6769ab21832b9c4a0e8e1d5df2b7377a (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.cpp | 3 |
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; |