D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5770 - Template constructor bypass access check
Summary: Template constructor bypass access check
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid, pull
Depends on:
Blocks:
 
Reported: 2011-03-23 06:46 UTC by Kenji Hara
Modified: 2017-07-19 17:42 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2011-03-23 06:46:34 UTC
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
}

----
Comment 1 SomeDude 2012-04-23 02:21:55 UTC
In the same vein, see also issue 7236
Comment 2 hsteoh 2014-11-06 01:56:34 UTC
Tested on git HEAD, Linux/64. Bug still occurs.
Comment 3 dransic 2015-03-24 15:03:08 UTC
Still in 2.067.0-rc1.
Comment 6 github-bugzilla 2015-04-12 07:32:22 UTC
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
Comment 7 Kenji Hara 2015-06-12 14:12:58 UTC
(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
Comment 9 github-bugzilla 2017-07-19 17:42:59 UTC
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