Closed Imperatorn closed 3 years ago
In C++ or in D? Sorry I don't get it, formatting destroyed it. Can you attach screenshot of what the source and the result?
edit: I think I get it, after searching on github it seems related to ncurses lib and terminals, where it is defined as a macro, so that wasn't actually a string literal or enum.
Minimal repro case
#define NOOP(a) a
#define BUG NOOP('`')
result
enum NOOP(a) = `a`;
enum BUG = `NOOP('`')`;
Minimal repro case
#define NOOP(a) a #define BUG NOOP('`')
result
enum NOOP(a) = `a`; enum BUG = `NOOP('`')`;
Correct :)
When generating enums, there's a small issue if the character used is backtick, since it's used for the value.
enum ACS_DIAMOND =
PDC_ACS('
')` <--This would not be handled properly. You would get "unterminated character constant"