Skip to content

Commit

Permalink
fix Issue 19857 - Name mangling mismatch when compiling with -dip1000
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright committed May 14, 2019
1 parent 9585ab8 commit 63201b7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/dmd/semantic3.d
Original file line number Diff line number Diff line change
Expand Up @@ -1180,6 +1180,8 @@ private extern(C++) final class Semantic3Visitor : Visitor
if (funcdecl.type == f)
f = cast(TypeFunction)f.copy();
f.isreturn = true;
if (funcdecl.storage_class & STC.returninferred)
f.isreturninferred = true;
}
}

Expand Down
18 changes: 18 additions & 0 deletions test/compilable/scopeinfer.d
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,21 @@ static assert(typeof(foo).mangleof == "FNaNbNiNfPvZi");
auto bar(void* p) { return p; }
static assert(typeof(bar).mangleof == "FNaNbNiNfPvZQd");

// https://issues.dlang.org/show_bug.cgi?id=19857

struct Stack()
{
@safe:
int** data;
ref int* top()
{
return *data;
}
}

alias S = Stack!();

//pragma(msg, S.top.mangleof);

version (Win32)
static assert(S.top.mangleof == "_D4test__T5StackZQh3topMFNaNbNcNiNfZPi");

0 comments on commit 63201b7

Please sign in to comment.