diff options
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index c0cb461418b..b15e52aeb2c 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -742,12 +742,11 @@ void UnwrappedLineParser::parsePPEndIf() { // preprocessor indent. unsigned TokenPosition = Tokens->getPosition(); FormatToken *PeekNext = AllTokens[TokenPosition]; - if (FoundIncludeGuardStart && PPBranchLevel == -1 && PeekNext->is(tok::eof)) { - for (auto &Line : Lines) { + if (FoundIncludeGuardStart && PPBranchLevel == -1 && PeekNext->is(tok::eof) && + Style.IndentPPDirectives != FormatStyle::PPDIS_None) + for (auto &Line : Lines) if (Line.InPPDirective && Line.Level > 0) --Line.Level; - } - } } void UnwrappedLineParser::parsePPDefine() { |