]> granicus.if.org Git - clang/commitdiff
clang-format: Don't put useless space in f( ::g()).
authorDaniel Jasper <djasper@google.com>
Thu, 7 Feb 2013 21:08:36 +0000 (21:08 +0000)
committerDaniel Jasper <djasper@google.com>
Thu, 7 Feb 2013 21:08:36 +0000 (21:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174662 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTest.cpp

index ad3baae00d49ebfadea0fcc61a26ec6e683e7122..8a384540d8f57ba366a18bd98ae7ec3a78d65028 100644 (file)
@@ -830,7 +830,8 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
   if (Left.is(tok::coloncolon))
     return false;
   if (Right.is(tok::coloncolon))
-    return Left.isNot(tok::identifier) && Left.isNot(tok::greater);
+    return Left.isNot(tok::identifier) && Left.isNot(tok::greater) &&
+           Left.isNot(tok::l_paren);
   if (Left.is(tok::less) || Right.is(tok::greater) || Right.is(tok::less))
     return false;
   if (Right.is(tok::amp) || Right.is(tok::star))
index 6924e45504078624efec42332eb6baf8f5618622..8ea0ff1604cd8a11cafff46fa9ce7b849fd13a57 100644 (file)
@@ -147,8 +147,9 @@ TEST_F(FormatTest, FormatsNestedCall) {
   verifyFormat("Method(f1(f2, (f3())));");
 }
 
-TEST_F(FormatTest, ImportantSpaces) {
+TEST_F(FormatTest, NestedNameSpecifiers) {
   verifyFormat("vector< ::Type> v;");
+  verifyFormat("::ns::SomeFunction(::ns::SomeOtherFunction())");
 }
 
 TEST_F(FormatTest, OnlyGeneratesNecessaryReplacements) {