Menu

#552 Unexpected padding in reference variable during structure initialization

closed-fixed
None
2023-08-30
2023-06-22
No

--align-reference=type option add a space after the reference symbol.

struct Hoge {
    int* i;
    int* j;
    int* k;
};

int i, j, k = 0;

Hoge hoge {
    &i,
    &j,
    &k
};

becomes

Hoge hoge {
    &i,

-   &j,
-   &k
+   & j,
+   & k
};

I ran astye as follows:

$ astyle --version
Artistic Style Version 3.4
$ astyle --options=none --align-reference=type test.cpp

Discussion

  • André Simon

    André Simon - 2023-06-23
    • 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.

     
    👍
    1
  • 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

     
  • Taira Ryosuke

    Taira Ryosuke - 2023-08-30

    Thank you for the fix.
    It is working fine for me.

     

Log in to post a comment.

MongoDB Logo MongoDB