Bug 22073 – importC: Error: found '.' when expecting ';' following compound literal

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-06-22T19:49:55Z
Last change time
2021-06-24T17:01:38Z
Keywords
pull
Assigned to
No Owner
Creator
Iain Buclaw

Comments

Comment #0 by ibuclaw — 2021-06-22T19:49:55Z
Compound literals are a postfix-expression, and so can be followed by any other postfix-expression in the statement, as per C11 6.5.2 --- postfix-expression: primary-expression postfix-expression [ expression ] postfix-expression ( argument-expression-list (opt) ) postfix-expression . identifier postfix-expression -> identifier postfix-expression ++ postfix-expression -- ( type-name ) { initializer-list } ( type-name ) { initializer-list , } --- Reduced test: --- struct S { int field; }; void test() { (struct S) { 42 }.field = 24; // valid lvalue, see issue 22072. int var = (struct S) { 42 }.field; }
Comment #1 by dlang-bot — 2021-06-24T06:56:50Z
@ibuclaw created dlang/dmd pull request #12745 "fix Issue 22073 - importC: Error: found '.' when expecting ';' following compound literal" fixing this issue: - fix Issue 22073 - importC: Error: found '.' when expecting ';' following compound literal https://github.com/dlang/dmd/pull/12745
Comment #2 by dlang-bot — 2021-06-24T17:01:38Z
dlang/dmd pull request #12745 "fix Issue 22073 - importC: Error: found '.' when expecting ';' following compound literal" was merged into master: - bdd7a78410da871890ad45d2c738d134cdaf2767 by Iain Buclaw: fix Issue 22073 - importC: Error: found '.' when expecting ';' following compound literal https://github.com/dlang/dmd/pull/12745