]> granicus.if.org Git - clang/commitdiff
Formatter: Remove an always-false condition.
authorNico Weber <nicolasweber@gmx.de>
Sat, 12 Jan 2013 07:05:25 +0000 (07:05 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sat, 12 Jan 2013 07:05:25 +0000 (07:05 +0000)
canBreakBefore() does not allow breaking after ':' for LT_ObjCMethodDecl lines,
so if Newline is true in addTokenToState() for ':' then LT_ObjCMethodDecl
cannot be set. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172307 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Format/Format.cpp

index 89fbf61da0d75842ab0d8b1312ef7c69be3ae754..ec8b02ffcadf8a5e2451c5248605fab8e3976384 100644 (file)
@@ -386,8 +386,7 @@ private:
       }
 
       State.Stack[ParenLevel].LastSpace = State.Column;
-      if (Current.is(tok::colon) && CurrentLineType != LT_ObjCMethodDecl &&
-          State.NextToken->Type != TT_ConditionalExpr)
+      if (Current.is(tok::colon) && State.NextToken->Type != TT_ConditionalExpr)
         State.Stack[ParenLevel].Indent += 2;
     } else {
       if (Current.is(tok::equal) && RootToken.is(tok::kw_for))