Test code: ---- module a struct S { private: this(int n){} } struct T { private: this(A...)(A args){} } ---- module b; import a; void main() { // auto s = S(10); // is not accessible auto t = T(20); // compile succeeded, NG } ----
In the same vein, see also issue 7236
Tested on git HEAD, Linux/64. Bug still occurs.
Still in 2.067.0-rc1.
https://github.com/D-Programming-Language/dmd/pull/4558
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/981bb7be7d84a2bd3b19e19c4304b27909e10f8a Supplemental fix for issue 5770 https://github.com/D-Programming-Language/phobos/commit/4ffdb997337452e74b656d48218ac8a1390df90c Merge pull request #3151 from 9rnsr/fix5770 Supplemental fix for issue 5770
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/4cd6985729ae349d869624146c5e57ec1fe8ff2b fix Issue 5770 - Template constructor bypass access check It had caused by the incomplete implementation of access check. Most part of `access.c` was old code from ancient D ages. https://github.com/D-Programming-Language/dmd/commit/b2e2f80d365728f54f602efa2cb56bdc87c69b7a Merge pull request #4558 from 9rnsr/fix5770 Issue 5770 - Template constructor bypass access check
(In reply to Kenji Hara from comment #4) > https://github.com/D-Programming-Language/dmd/pull/4558 I reverted the fix in: https://github.com/D-Programming-Language/dmd/pull/4730
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/4cd6985729ae349d869624146c5e57ec1fe8ff2b fix Issue 5770 - Template constructor bypass access check https://github.com/D-Programming-Language/dmd/commit/b2e2f80d365728f54f602efa2cb56bdc87c69b7a Merge pull request #4558 from 9rnsr/fix5770
Commits pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/981bb7be7d84a2bd3b19e19c4304b27909e10f8a Supplemental fix for issue 5770 https://github.com/dlang/phobos/commit/4ffdb997337452e74b656d48218ac8a1390df90c Merge pull request #3151 from 9rnsr/fix5770