Closed
Description
When macros are used in an initializer, clang-reorder-fields
edits the macros themselves instead of reordering their uses. Example:
$ cat foo.c
struct foo {
int bar;
int baz;
};
#define BAR 0
#define BAZ 1
struct foo global = {
BAR,
BAZ,
};
$ clang-reorder-fields --record-name=foo --fields-order=baz,bar foo.c --
struct foo {
int baz;
int bar;
};
#define BAR BAZ
#define BAZ BAR
struct foo global = {
BAR,
BAZ,
};