D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 20094 - POSIX: Wrong substitution for templates with argument in same namespace
Summary: POSIX: Wrong substitution for templates with argument in same namespace
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All Other
: P1 regression
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-01 04:42 UTC by Mathias LANG
Modified: 2019-08-01 10:05 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Mathias LANG 2019-08-01 04:42:36 UTC
```
extern(C++, "xdr")
{
    struct xvector (T) {}
    alias Value = xvector!(ubyte);
}

extern(C++) void test200XX(xvector!(Value)* v);
static assert(test200XX.mangleof == `_Z9test200XXPN3xdr7xvectorIS0_IhEEE`);
```

This fails. Mangling difference:
Expected: _Z9test200XXPN3xdr7xvectorIS0_IhEEE
Actual:   _Z9test200XXPN3xdr7xvectorIS_IhEEE

Notice that `S_` (the first element) is used, instead of `S0_` (the second).
So it seems like one element is not properly added to the array of elements.
Will work on a fix. Most likely introduced by some large refactoring in 2.087.
Comment 1 Mathias LANG 2019-08-01 10:05:38 UTC
Fixed by https://github.com/dlang/dmd/pull/10256
Also there was a second regression in there, in that the `S0_` substitution should be surrounded by `N .. E`, and that's fixed by https://github.com/dlang/dmd/pull/10257