Bug 23038 – importC: sizeof inside struct has struct members in scope

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-04-19T13:35:29Z
Last change time
2022-05-05T21:04:15Z
Keywords
ImportC, pull
Assigned to
No Owner
Creator
duser
See also
https://issues.dlang.org/show_bug.cgi?id=23039

Comments

Comment #0 by duser — 2022-04-19T13:35:29Z
char a; struct { long long a; char b[sizeof(a)]; //typeof(a) c; } s; _Static_assert(sizeof(s.b) == sizeof(char), "1"); // fails //_Static_assert(sizeof(s.c) == sizeof(char), "2"); // fails dmd uses the struct field named "a", other compilers use the global found when testing the typeof() PR (it is affected too)
Comment #1 by dlang-bot — 2022-04-22T22:28:01Z
@WalterBright created dlang/dmd pull request #14021 "fix Issue 23038 - importC: sizeof inside struct has struct members in…" fixing this issue: - fix Issue 23038 - importC: sizeof inside struct has struct members in scope https://github.com/dlang/dmd/pull/14021
Comment #2 by dlang-bot — 2022-04-25T15:26:12Z
dlang/dmd pull request #14021 "fix Issue 23038 - importC: sizeof inside struct has struct members in…" was merged into stable: - 2dcecffd29a1e9d946d907d7dea8391574211b61 by Walter Bright: fix Issue 23038 - importC: sizeof inside struct has struct members in scope https://github.com/dlang/dmd/pull/14021
Comment #3 by dlang-bot — 2022-05-05T21:04:15Z
dlang/dmd pull request #14064 "merge stable" was merged into master: - c0cff59c79020fabe3ae6487aaad2e9f1850aaf5 by Walter Bright: fix Issue 23038 - importC: sizeof inside struct has struct members in scope https://github.com/dlang/dmd/pull/14064