The new option --attach-return-type-decl in AStyle 3.1 gives wrong result with a sequence "macro->access modifier->constructor". It's a popular code template in Qt projects, so this bug is very annoying.
./astyle --options=none --attach-return-type-decl < test.cpp
class MyClass : public QObject
{
Q_OBJECT
public:
MyClass();
};
Result:
class MyClass : public QObject
{
Q_OBJECT
public: MyClass();
};
Hi, you might test a fix in git (https://gitlab.com/saalen/astyle/) until a new version is released.
Fixed in version 3.4.6