aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index 3bedc6a4cd..7f1131ca6f 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -371,8 +371,9 @@ private:
if (Newlines == 0 && Offset != 0)
Newlines = 1;
unsigned Indent = Line.Level * 2;
- if (Token.Tok.is(tok::kw_public) || Token.Tok.is(tok::kw_protected) ||
- Token.Tok.is(tok::kw_private))
+ if ((Token.Tok.is(tok::kw_public) || Token.Tok.is(tok::kw_protected) ||
+ Token.Tok.is(tok::kw_private)) &&
+ static_cast<int>(Indent) + Style.AccessModifierOffset >= 0)
Indent += Style.AccessModifierOffset;
replaceWhitespace(Token, Newlines, Indent);
return Indent;