mirror of
https://github.com/dlang/dmd.git
synced 2025-04-28 14:10:11 +03:00
Fix bugzilla 24375 - ImportC: .di generator outputs C expression with ->
operator
This commit is contained in:
parent
04025fdba6
commit
e4e00b14ce
2 changed files with 12 additions and 4 deletions
|
@ -2682,10 +2682,7 @@ private void expressionPrettyPrint(Expression e, ref OutBuffer buf, ref HdrGenSt
|
||||||
void visitDotId(DotIdExp e)
|
void visitDotId(DotIdExp e)
|
||||||
{
|
{
|
||||||
expToBuffer(e.e1, PREC.primary, buf, hgs);
|
expToBuffer(e.e1, PREC.primary, buf, hgs);
|
||||||
if (e.arrow)
|
buf.writeByte('.');
|
||||||
buf.writestring("->");
|
|
||||||
else
|
|
||||||
buf.writeByte('.');
|
|
||||||
buf.writestring(e.ident.toString());
|
buf.writestring(e.ident.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,11 @@ extern (C)
|
||||||
int x = void;
|
int x = void;
|
||||||
}
|
}
|
||||||
const(S24326) fun(int y);
|
const(S24326) fun(int y);
|
||||||
|
struct foo
|
||||||
|
{
|
||||||
|
int x = void;
|
||||||
|
}
|
||||||
|
alias weird = int[(cast(foo*)cast(void*)0).x.sizeof];
|
||||||
/+enum int __DATE__ = 1+/;
|
/+enum int __DATE__ = 1+/;
|
||||||
/+enum int __TIME__ = 1+/;
|
/+enum int __TIME__ = 1+/;
|
||||||
/+enum int __TIMESTAMP__ = 1+/;
|
/+enum int __TIMESTAMP__ = 1+/;
|
||||||
|
@ -85,3 +90,9 @@ enum { A };
|
||||||
// https://issues.dlang.org/show_bug.cgi?id=24670
|
// https://issues.dlang.org/show_bug.cgi?id=24670
|
||||||
struct S24326 { int x; };
|
struct S24326 { int x; };
|
||||||
const struct S24326 fun(int y);
|
const struct S24326 fun(int y);
|
||||||
|
|
||||||
|
// https://issues.dlang.org/show_bug.cgi?id=24375
|
||||||
|
struct foo {
|
||||||
|
int x;
|
||||||
|
};
|
||||||
|
typedef int weird[sizeof(((struct foo *)((void*)0))->x)];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue