[PATCH] Revamp indentation behavior for complex binary expressions.

Manuel Klimek klimek at google.com
Mon Apr 8 13:08:31 PDT 2013


  LG


================
Comment at: lib/Format/TokenAnnotator.cpp:803
@@ -804,4 +802,3 @@
           CurrentPrecedence = 1 + (int) prec::Conditional;
-        else if (Current->is(tok::semi) || Current->Type == TT_InlineASMColon ||
-                 Current->Type == TT_CtorInitializerColon)
+        else if (Current->is(tok::semi) || Current->Type == TT_InlineASMColon)
           CurrentPrecedence = 1;
----------------
Daniel Jasper wrote:
> Manuel Klimek wrote:
> > Daniel Jasper wrote:
> > > Manuel Klimek wrote:
> > > > Why did this change?
> > > Because it is no longer necessary to "cheat" by regarding constructor initializers as binary operators. They follow different rules and thus should be handled in a different fashion.
> > I assume that was already the case before, and is not necessarily related to this change?
> There is another change in line Format.cpp:868 that basically does the same thing, but at a more appropriate location. Otherwise the handling of those colons don't play nice with the new binary expression indentation.
Ah, I missed that...


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



More information about the cfe-commits mailing list