aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-02-14 09:19:04 +0000
committerDaniel Jasper <djasper@google.com>2013-02-14 09:19:04 +0000
commitc5cfa490a1fa4eb1a3a17803c6125b42abd73455 (patch)
treec351b422ff16b9dd9e88dbd0d03e0c125c21bb4d /lib/Format/Format.cpp
parent31672fb8c3fd3410725c9a4f293810ab69889020 (diff)
Get less confused by trailing comma in Google style.
The formatter can now format: void aaaaaaaaaaaaaaaaaa(int level, double *min_x, double *max_x, double *min_y, double *max_y, double *min_z, double *max_z, ) { } Although this is invalid code, it frequently happens during development and clang-format should be nicer :-). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175151 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index 1bd864e5c9..f03b77853c 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -781,7 +781,8 @@ private:
return true;
if (State.NextToken->Parent->is(tok::comma) &&
State.Stack.back().BreakBeforeParameter &&
- !isTrailingComment(*State.NextToken))
+ !isTrailingComment(*State.NextToken) &&
+ State.NextToken->isNot(tok::r_paren))
return true;
// FIXME: Comparing LongestObjCSelectorName to 0 is a hacky way of finding
// out whether it is the first parameter. Clean this up.