Bug 14407 – No protection and attributes check for class/struct allocator in NewExp

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-04-05T02:44:00Z
Last change time
2016-02-01T10:30:44Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2015-04-05T02:44:35Z
Test case: a.d: -------------------------------- deprecated class C { private deprecated new (size_t, string) { return null; } private this(int) {} } deprecated struct S { private deprecated new (size_t, string) { return null; } private this(int) {} } b.d: -------------------------------- import a; void main() pure nothrow @safe @nogc { // auto c = new("arg") C(0); // Deprecation: class a.C is deprecated // Deprecation: class a.C is deprecated <-- duplicated message // <-- no attribute errors for allocator // <-- no access error for allocator // Error: pure function 'D main' cannot call impure function 'a.C.this' // Error: safe function 'D main' cannot call system function 'a.C.this' // Error: @nogc function 'D main' cannot call non-@nogc function 'a.C.this' // Error: class a.C member this is not accessible // Deprecation: class a.C is deprecated // Error: constructor this is not nothrow // Error: function 'D main' is nothrow yet may throw auto s = new("arg") S(0); // Same with class new }
Comment #1 by k.hara.pg — 2015-04-05T02:59:55Z
Comment #2 by github-bugzilla — 2015-04-18T02:42:32Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c8481e5ade15af91d39fc3cdf0cf1a6270b2403f fix Issue 14407 - No protection and attributes check for class/struct allocator in NewExp https://github.com/D-Programming-Language/dmd/commit/ca346f2511a24e3ebfb1b5e7088fd3d616709bbc Merge pull request #4555 from 9rnsr/fix14407 Issue 14407 - No protection and attributes check for class/struct allocator in NewExp
Comment #3 by github-bugzilla — 2015-06-17T21:04:44Z
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c8481e5ade15af91d39fc3cdf0cf1a6270b2403f fix Issue 14407 - No protection and attributes check for class/struct allocator in NewExp https://github.com/D-Programming-Language/dmd/commit/ca346f2511a24e3ebfb1b5e7088fd3d616709bbc Merge pull request #4555 from 9rnsr/fix14407
Comment #4 by github-bugzilla — 2016-02-01T10:30:44Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f137b31edae2200cc30014eaee386ad0ac93910f Supplemental fix for issue 14407 - Add missing nothrow check for allocator in NewExp