---- bug.d ---- struct Foo(int i) { } version (A) { Foo!3 fooa; Foo!3u foob; } else { Foo!3u fooa; Foo!3 foob; } pragma(msg, typeof(fooa).mangleof); pragma(msg, typeof(foob).mangleof); ---- dmd -c bug.d S3bug11__T3FooVk3Z3Foo S3bug11__T3FooVk3Z3Foo ---- dmd -c -version=A bug.d S3bug11__T3FooVi3Z3Foo S3bug11__T3FooVi3Z3Foo ---- The mangling should depend on the template value parameter type not the type of the argument.
cat > bug.d << EOF struct S128(T, int k=1) { } version (A) { alias S128!(int) fooa; alias S128!(int, 1) foob; } else { alias S128!(int, 1) fooa; alias S128!(int) foob; } pragma(msg, fooa.mangleof); pragma(msg, foob.mangleof); EOF dmd -c bug.d dmd -c -version=A bug.d ---- S3bug14__T4S128TiVi1Z4S128 S3bug14__T4S128TiVi1Z4S128 ---- S3bug11__T4S128TiZ4S128 S3bug11__T4S128TiZ4S128 ---- Similar bug with default values.
https://github.com/D-Programming-Language/dmd/pull/701
Fixing this issue would allow us to use the mangling as hash key for looking up existing template instantiations. Currently the template arguments are used for comparison and to compute the hash (TemplateDeclaration::findExistingInstance).
*** Issue 12020 has been marked as a duplicate of this issue. ***
*** Issue 12720 has been marked as a duplicate of this issue. ***
https://github.com/D-Programming-Language/dmd/pull/3536 I think this is important to stabilize symbol mangling. Change to 'major' bug.
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/2c1a8f8eafecd92a2b5d782e6921bd6b6935d3bb Supplemental fix for issue 7469 https://github.com/D-Programming-Language/phobos/commit/e85fb39f88597f3e3df1d043d3704ffb69970699 Merge pull request #2153 from 9rnsr/fix7469 Supplemental fix for issue 7469
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/cc5029603a0ce7051b7e24642705c1d8ec6c5e02 fix Issue 7469 - template mangling depends on instantiation order https://github.com/D-Programming-Language/dmd/commit/5c5bd27f748e5b2b095915bfd187ab7561d6d142 Merge pull request #3536 from 9rnsr/fix7469 Issue 7469 - template mangling depends on instantiation order
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c9120823c6740dc8141ac153f4da56600b147d73 [Refactoring] Remove comment-out code for the fixed issue 7469
*** Issue 10914 has been marked as a duplicate of this issue. ***
*** Issue 12696 has been marked as a duplicate of this issue. ***