dmd/compiler/test/compilable/test20344.d
drpriver e9984553e6
Fix 20334: ImportC: enums created from string literal #defines don’t implicitly convert to const(char)* in D. (#21193)
Fixes: https://github.com/dlang/dmd/issues/20334

After preprocessing, #defines in C code that are just string literals
are converted into D enums. As these are collected for use in D code,
they should behave like D string literals and not C string literals.
2025-04-11 05:08:10 +08:00

14 lines
274 B
D

// https://github.com/dlang/dmd/issues/20334
// EXTRA_FILES: imports/imp20344.c
import imports.imp20344;
string s = X;
const(char)* p = X;
void takes_string(string){ }
void takes_char_star(const(char)*){ }
void test20344(){
takes_string(X);
takes_char_star(X);
}