[PATCH] Formatter: Correctly format stars in `sizeof(int**)` and similar places.

Daniel Jasper djasper at google.com
Tue Feb 12 00:23:11 PST 2013


  The patch looks good, the surrounding doesn't ;-). We (I) seriously need to clean up the spaceRequired..() methods. Doesn't really make sense to test for star and amp directly as we already know what type of token we are dealing with. But I will do this in a follow-up patch.


================
Comment at: lib/Format/TokenAnnotator.cpp:939
@@ -934,3 +938,3 @@
            (Left.isNot(tok::star) && Left.isNot(tok::amp) &&
-            !Style.PointerBindsToType);
+            Left.isNot(tok::l_paren) && !Style.PointerBindsToType);
   if (Left.is(tok::amp) || Left.is(tok::star))
----------------
How is this connected to the rest of the change?


http://llvm-reviews.chandlerc.com/D384



More information about the cfe-commits mailing list