Clava should add a regression test for designated initializers that select fields through anonymous unions and structs.
This is the exact input used for the corresponding clang-dumper regression test:
struct anonymous_union {
union {
int value;
};
};
struct nested_anonymous_union {
union {
struct {
int value;
};
};
};
struct anonymous_union first = { .value = 1 };
struct nested_anonymous_union second = { .value = 2 };
Parse this input with the clang-dumper data and regenerate the code through Clava. The anonymous union and struct declarations should remain anonymous, and the initializers should be reconstructed with the source spelling:
struct anonymous_union first = { .value = 1 };
struct nested_anonymous_union second = { .value = 2 };
In particular, Clava must emit .value, not ..value, for both the direct and nested cases. Formatting may differ, but the designated initializer structure must remain faithful.
The clang-dumper fix is tracked in specs-feup/clang-dumper#48 and PR #49. The producer fix removes synthetic unnamed path entries from the source-level designator list. This issue covers adding the Clava consumer test and confirming that the available data is sufficient for faithful reconstruction.
Clava should add a regression test for designated initializers that select fields through anonymous unions and structs.
This is the exact input used for the corresponding clang-dumper regression test:
Parse this input with the clang-dumper data and regenerate the code through Clava. The anonymous union and struct declarations should remain anonymous, and the initializers should be reconstructed with the source spelling:
In particular, Clava must emit
.value, not..value, for both the direct and nested cases. Formatting may differ, but the designated initializer structure must remain faithful.The clang-dumper fix is tracked in specs-feup/clang-dumper#48 and PR #49. The producer fix removes synthetic unnamed path entries from the source-level designator list. This issue covers adding the Clava consumer test and confirming that the available data is sufficient for faithful reconstruction.