Menu ▾ ▴

#589 astyle 3.6.8 (git 2025-03-14): incorrect switch indentation

open-accepted
None
2026-02-13
2025-03-14
Zenju
No

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

namespace fff
{
struct LastRunStats
{
};

bool getDefaultSortDirection(ColumnTypeCfg colType)
{
    switch (colType)
    {
    case ColumnTypeCfg::name:
                return true;
    case ColumnTypeCfg::lastSync:
                return false;
    case ColumnTypeCfg::lastLog:
                return true;
    }
    return true;
}
}

The expected "switch" indentation should be:

namespace fff
{
struct LastRunStats
{
};

bool getDefaultSortDirection(ColumnTypeCfg colType)
{
    switch (colType)
    {
        case ColumnTypeCfg::name:
            return true