Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named initializer AST is ambiguous for [ENUMERATOR] = ... vs .prop = ... #466

Open
simonlindholm opened this issue Jun 28, 2022 · 0 comments

Comments

@simonlindholm
Copy link
Contributor

struct A { int x; };
struct A a = {
    .x = 1
};

and

enum { x };
int a[] = {
    [x] = 1
};

both result in a Decl with

init=InitList(exprs=[NamedInitializer(name=[ID(name='x')],
                                      expr=Constant(type='int', value='1'))]),

(The serializer choses to emit .x = 1 in this case.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants