[PATCH] D30487: ClangFormat - Add option to break before inheritance separation operator in class declaration

Andi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 10 06:33:02 PST 2017


Abpostelnicu added inline comments.


================
Comment at: lib/Format/ContinuationIndenter.cpp:355
 
+  if (Current.is(TT_InheritanceColon))
+    State.Stack.back().NoLineBreak = true;
----------------
djasper wrote:
> Can you leave a comment here:
> 
>   // Don't break within the inheritance declaration unless the ":" is on a new line.
I've modified the comment since this should be valid only if Style.BreakBeforeInheritanceComma is set to true otherwise we would be in the strange case where the input where the input is: 

```
class A : public B,
              public C {}
```
And this would be translated to something like:

```
class A 
  : public B,
    public C {}
```
 


Repository:
  rL LLVM

https://reviews.llvm.org/D30487





More information about the cfe-commits mailing list