Bug 24640 – ImportC: defines of one symbol to another are not converted to enums

Status
NEW
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-06-30T03:49:39Z
Last change time
2024-12-13T19:36:07Z
Keywords
ImportC
Assigned to
No Owner
Creator
Steven Schveighoffer
Moved to GitHub: dmd#20478 →

Comments

Comment #0 by schveiguy — 2024-06-30T03:49:39Z
importc.c: #define A 1 #define B A #define C (A) #define D (B) file.d: import importc; static assert(A == B); // undefined identifier: B static assert(A == C); // OK! static assert(A == D); // undefined identifier: B I'm uncertain whether D should work, if B does not work. But I think this would require somehow expanding the macro for B before translating the code.
Comment #1 by robert.schadek — 2024-12-13T19:36:07Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20478 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB