Addi formatting tests for pointer template parameters.

Fix spacing before ",".

llvm-svn: 169746
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 7f1131c..e8faa12a 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -689,6 +689,8 @@
   }
 
   bool spaceRequiredBetween(Token Left, Token Right) {
+    if (Right.is(tok::r_paren) || Right.is(tok::semi) || Right.is(tok::comma))
+      return false;
     if (Left.is(tok::kw_template) && Right.is(tok::less))
       return true;
     if (Left.is(tok::arrow) || Right.is(tok::arrow))
@@ -725,8 +727,6 @@
       return false;
     if (Left.is(tok::hash))
       return false;
-    if (Right.is(tok::r_paren) || Right.is(tok::semi) || Right.is(tok::comma))
-      return false;
     if (Right.is(tok::l_paren)) {
       return !Left.isAnyIdentifier() || isIfForOrWhile(Left);
     }