summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-11-23 14:51:47 +0000
committerDaniel Jasper <djasper@google.com>2013-11-23 14:51:47 +0000
commit40bc7466a84ffbf5f5e900fb6fe69775809f57ab (patch)
tree46224073e06667425f12f863da51248d5c497a05 /clang/lib/Format
parent446d1cd32ca5dcde8ca1d81c7c127ce659aa82c1 (diff)
downloadbcm5719-llvm-40bc7466a84ffbf5f5e900fb6fe69775809f57ab.tar.gz
bcm5719-llvm-40bc7466a84ffbf5f5e900fb6fe69775809f57ab.zip
clang-format: Fix incorrect space in parameters named by comment.
This fixes llvm.org/PR17979. Before: void f() { g(/*aaa=*/x, /*bbb=*/ !y); } After: void f() { g(/*aaa=*/x, /*bbb=*/!y); } llvm-svn: 195553
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index e841b94474a..804db628339 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1303,6 +1303,8 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
return !Left.Children.empty(); // No spaces in "{}".
if (Left.is(tok::l_brace) || Right.is(tok::r_brace))
return !Style.Cpp11BracedListStyle;
+ if (Left.Type == TT_BlockComment && Left.TokenText.endswith("=*/"))
+ return false;
if (Right.Type == TT_UnaryOperator)
return !Left.isOneOf(tok::l_paren, tok::l_square, tok::at) &&
(Left.isNot(tok::colon) || Left.Type != TT_ObjCMethodExpr);
@@ -1312,8 +1314,6 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
return false;
if (Left.is(tok::period) || Right.is(tok::period))
return false;
- if (Left.Type == TT_BlockComment && Left.TokenText.endswith("=*/"))
- return false;
if (Right.is(tok::hash) && Left.is(tok::identifier) && Left.TokenText == "L")
return false;
return true;
OpenPOWER on IntegriCloud