google-astyle icon indicating copy to clipboard operation
google-astyle copied to clipboard

Nested classes are not properly formatted under --style=linux

Open bruce-visscher opened this issue 5 years ago • 1 comments

Given this defintion in foo.h:

class A
{
    class B {
    };
};

When I format this using

google-astyle --style=linux foo.h

Then the opening brace for the nested class "B" is incorrectly lined up in the first column:

class A
{
    class B
{
    };
};

I note that if I change "class B" to "struct B" then it lines up properly.

bruce-visscher avatar Jul 05 '19 23:07 bruce-visscher

Okay, so apparently, google-astyle is a stale clone of AStyle which resides at source forge? AStyle doesn't seem to have this issue. (If I am correct then the solution to this would be to resync with AStyle but better might be to switch to using AStyle).

bruce-visscher avatar Jul 06 '19 00:07 bruce-visscher