Menu

#591 astyle 3.6.8 (git 2025-03-14): incorrect function-scope class indentation

closed-fixed
None
2025-03-26
2025-03-14
Zenju
No

AStyle built from git 2025-03-14 code produces: (full repro when inside .cpp file)

namespace testing
{
class AssertHelper
{
    struct X
    {
    };
};

void RegisterTest()
{
class FactoryTest : public internal::TestFactoryBase
    {
        public:
    FactoryImpl(int f) {}
    Test* CreateTest() override { return nullptr; }
    };
}
}

The expected "class" indentation should be:

namespace testing
{
class AssertHelper
{
    struct X
    {
    };
};

void RegisterTest()
{
    class FactoryTest : public internal::TestFactoryBase
    {
    public:
        FactoryImpl(int f) {}
        Test* CreateTest() override { return nullptr; }
    };
}
}

using

--style=allman
--suffix=none
--keep-one-line-blocks
--align-pointer=type
--min-conditional-indent=0
--max-continuation-indent=80
--indent-switches
--indent-col1-comments
--indent-preproc-block
--indent-preproc-define
--pad-header
--pad-comma
--formatted
--lineend=linux
--indent-preproc-block
--convert-tabs
--preserve-ws

Discussion

  • Zenju

    Zenju - 2025-03-17
     

    Last edit: Zenju 2025-03-17
  • Zenju

    Zenju - 2025-03-21

    The ticked can be closed! Apparently the latest changes to
    https://sourceforge.net/p/astyle/bugs/585/
    fixed this one as well! Thanks!

     
  • André Simon

    André Simon - 2025-03-26
    • status: open --> closed-fixed
    • assigned_to: André Simon
     

Log in to post a comment.