dfmt icon indicating copy to clipboard operation
dfmt copied to clipboard

Type analysis required

Open qznc opened this issue 9 years ago • 1 comments

Here is another tricky example, which should be unchanged:

unittest {
    int* a;
    int x, y;
    x * y;
    x * *a;
}

However, currently dfmt outputs:

unittest
{
    int* a;
    int x, y;
    x* y;
    x** a;
}

To format this correctly, just parsing is not enough. Ultimately, you need to do type analysis for user defined types to handle such cases.

qznc avatar Aug 08 '15 18:08 qznc

Given that this should be very rare (Who defines a non-const overload of the * operator? And if it's not const, why ignore the result?) I'm not going to prioritize this.

Hackerpilot avatar Aug 09 '15 03:08 Hackerpilot