#227 Multiplication within DEFINITION_TYPE detected as pointer

closed-fixed
None
2015-01-03
2013-07-04
Mika Attila
No

Multiplication within a namespace/class/struct/etc is detected as a pointer by ASFormatter::isPointerOrReference().

Example:

struct Bar
{
    int foo = 2;
    int bar = 4;
    int baz = foo * bar;
};

'baz = foo * bar' gets formatted to 'baz = foo* bar'

I found this line to be the culprit:
https://sourceforge.net/p/astyle/code/386/tree/trunk/AStyle/src/ASFormatter.cpp#l2522

ASFormatter::isPointerOrReference() seems to unconditionally accept every * as pointer, as long as it's in a DEFINITION_TYPE scope.

Discussion

  • Jim Pattee

    Jim Pattee - 2014-10-27
    • status: open --> open-fixed
    • assigned_to: Jim Pattee
    • Priority: 5 --> 7
     
  • Jim Pattee

    Jim Pattee - 2014-10-27

    Fixed.

     
  • Jim Pattee

    Jim Pattee - 2014-11-20
    • Status: open-fixed --> closed-fixed
     

Log in to post a comment.