dfmt
dfmt copied to clipboard
Type analysis required
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.
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.