Bug 5770 – Template constructor bypass access check

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-03-23T06:46:00Z
Last change time
2017-07-19T17:42:59Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2011-03-23T06:46:34Z
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 by lovelydear — 2012-04-23T02:21:55Z
In the same vein, see also issue 7236
Comment #2 by hsteoh — 2014-11-06T01:56:34Z
Tested on git HEAD, Linux/64. Bug still occurs.
Comment #3 by dransic — 2015-03-24T15:03:08Z
Still in 2.067.0-rc1.
Comment #4 by k.hara.pg — 2015-04-05T17:40:33Z
Comment #5 by github-bugzilla — 2015-04-08T15:01:04Z
Comment #6 by github-bugzilla — 2015-04-12T07:32:22Z
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 by k.hara.pg — 2015-06-12T14:12:58Z
Comment #8 by github-bugzilla — 2015-06-17T21:04:29Z
Comment #9 by github-bugzilla — 2017-07-19T17:42:59Z