This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
In a C99 project, an initializer field identifier in a compound literal seems to be resolved against the type of the variable being initialized rather than the type of the compound literal. struct Foo { int foo1; }; struct Foo *baz1 = &(struct Foo) { .foo1 = 0, // .foo1 is resolved }; void *baz2 = &(struct Foo) { .foo1 = 0, // .foo1 is NOT resolved }; struct Bar { int foo1; }; struct Bar *baz3 = (void *)&(struct Foo) { .foo1 = 0, // .foo1 is resolved }; void *baz4 = (void *)&(struct Foo) { .foo1 = 0, // .foo1 is NOT resolved };
Fixed in http://hg.netbeans.org/cnd-main/rev/bc712d97b7dd
Integrated into 'main-silver', will be available in build *201607210002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/bc712d97b7dd User: Petr Kudryavtsev <petrk@netbeans.org> Log: Fixed #257822 - Unresolved identifier in designated initializer of compound literal
*** Bug 255876 has been marked as a duplicate of this bug. ***
This is fixed as of nightly build 201608210002. However, a similar issue is still present if compound literals are used in statements instead of declarations: bug #267663
Integrated into 'main-silver', will be available in build *201608260002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/263dda368cc1 User: Petr Kudryavtsev <petrk@netbeans.org> Log: Additional fix for #257822 - Unresolved identifier in designated initializer of compound literal -- fixed case when there is no whitespace between rparen and lbrace in compund literal