AStyle built from git 2025-03-17 unexpectedly converts this: (full repro when inside .cpp file)
class CControlSocket
{
std::vector<std::unique_ptr<int>> operations_;
};
class CRealControlSocket : public CControlSocket
{
};
into this
class CControlSocket
{
std::vector<std::unique_ptr<int>> operations_;
};
class CRealControlSocket :
public CControlSocket
{
};
Note the unexpected line break before the "public CControlSocket"
Astyle config used:
--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
Something similar happens with the following example:
struct ObjectCache
{
std::vector<std::shared_ptr<int>> cache;
};
class CToken final
{
protected:
enum flags : unsigned char
{
numeric_left = 0x01,
};
};
Astyle adds an unwanted newline before the "unsigned char":
struct ObjectCache
{
std::vector<std::shared_ptr<int>> cache;
};
class CToken final
{
protected:
enum flags :
unsigned char
{
numeric_left = 0x01,
};
};
The ticked can be closed! Apparently the latest changes to
https://sourceforge.net/p/astyle/bugs/585/
fixed this one as well! Thanks!