Skip to content

Commit ef517c4

Browse files
authored
Merge pull request #10256 from Geod24/fix-20094
Fix 20094: Wrong C++ template substitution for arguments in the same namespace merged-on-behalf-of: Nicholas Wilson <[email protected]>
2 parents 378312c + be7d468 commit ef517c4

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/dmd/cppmangle.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,10 +560,10 @@ private final class CppMangleVisitor : Visitor
560560
}
561561
else
562562
{
563-
append(ti.tempdecl);
564563
this.writeNamespace(
565564
s.namespace, () {
566565
this.writeIdentifier(ti.tempdecl.toAlias().ident);
566+
append(ti.tempdecl);
567567
template_args(ti);
568568
}, haveNE);
569569
}

test/compilable/cppmangle.d

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,3 +1155,16 @@ version (Posix)
11551155
static assert(fun20022_5.mangleof == `_ZN7ns2002210fun20022_5ENS_11Enum20022_1E`);
11561156
static assert(fun20022_6.mangleof == `_ZN7ns2002210fun20022_6ENS_11Enum20022_2E`);
11571157
}
1158+
1159+
// https://issues.dlang.org/show_bug.cgi?id=20094
1160+
version (Posix)
1161+
{
1162+
extern(C++, "ns20094")
1163+
{
1164+
struct xvector20094 (T) {}
1165+
alias V20094 = xvector20094!(ubyte);
1166+
}
1167+
1168+
extern(C++) void test20094(xvector20094!(V20094)* v);
1169+
static assert(test20094.mangleof == `_Z9test20094PN7ns2009412xvector20094IS0_IhEEE`);
1170+
}

0 commit comments

Comments
 (0)