Issue 166761
Summary [clang-format] AlignWithSpaces does not work for base classes list
Labels clang-format
Assignees
Reporter zeule
    I'd expect the list of base classes to be aligned, and not indented:

```c++
class Foo: public Namespace1::Bar,
 public Namespace2::Baz
```
but clang-format fill the second line with tabs. In other words, I'd expect this following test to succeed:

```c++
TEST_F(FormatTest, AlignmentTemporary) {
    FormatStyle Tab = getLLVMStyleWithColumns(42);
    Tab.UseTab = FormatStyle::UT_AlignWithSpaces;
    verifyFormat("class Foo : public BarBarBar,\n"
                 "            public BazBazBaz\n",
 Tab);
}
```
But:
```
Expected equality of these values:
 ExpectedCode
    Which is: "class Foo : public BarBarBar,\n public BazBazBaz\n"
  FormattedCode
    Which is: "class Foo : public BarBarBar,\n\t    public BazBazBaz\n"
With diff:
@@ -1,2 +1,2 @@
 class Foo : public BarBarBar,
-            public BazBazBaz\n
+\t public BazBazBaz\n
```

`WhitespaceManager::appendIndentText()` for the second line is called with `C.IsAligned` set to `false`, and I can't figure out why even after I set it to true in ContinuationIndenter::addTokenOnCurrentLine() for tok::kw_public.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to