https://issues.dlang.org/show_bug.cgi?id=23378
Issue ID: 23378
Summary: ImportC: dynamic array alias imported by C treated as
pointer when used as function parameter.
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: ImportC
Severity: minor
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
Below is for a 64bit target:
// s.d
alias String = const(char)[];
// x.c
__import s;
_Static_assert(sizeof(String) == 16, "");
String bar;
_Static_assert(sizeof(bar) == 16, "");
void foo(String a){
_Static_assert(sizeof(a) == 16, ""); // this fails
const char* b = a; // this compiles, which implies the arg is just a
const(char)*
}
--