Menu

#504 [wrong formatted] --attach-return-type-decl with Q_OBJECT macro and constructor

closed-fixed
None
2023-08-29
2018-05-23
Igor K.
No

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();
};

Discussion

  • André Simon

    André Simon - 2023-06-26
    • status: open --> open-accepted
    • assigned_to: André Simon
     
  • André Simon

    André Simon - 2023-06-29

    Hi, you might test a fix in git (https://gitlab.com/saalen/astyle/) until a new version is released.

     
  • André Simon

    André Simon - 2023-08-29
    • status: open-accepted --> closed-fixed
     
  • André Simon

    André Simon - 2023-08-29

    Fixed in version 3.4.6

     

Log in to post a comment.

MongoDB Logo MongoDB