Bug 12630 – @nogc should recognize compile-time evaluation context

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-04-24T03:43:00Z
Last change time
2014-04-24T19:19:40Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2014-04-24T03:43:54Z
This code should be compiled with -o-, but doesn't. void main() @nogc { static const ex1 = new Exception("invalid"); //enum ex2 = new Exception("invalid"); static const arr1 = [[1,2], [3, 4]]; enum arr2 = [[1,2], [3, 4]]; static const aa1 = [1:1, 2:2]; enum aa2 = [1:1, 2:2]; static const v1 = aa1[1]; enum v2 = aa2[1]; Object o; static const del1 = (delete o).sizeof; enum del2 = (delete o).sizeof; int[] a; static const len1 = (a.length = 1).sizeof; enum len2 = (a.length = 1).sizeof; static const cata1 = (a ~= 1).sizeof; enum cata2 = (a ~= 1).sizeof; static const cat1 = (a ~ a).sizeof; enum cat2 = (a ~ a).sizeof; }
Comment #1 by k.hara.pg — 2014-04-24T03:51:36Z
Comment #2 by github-bugzilla — 2014-04-24T19:19:40Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/1cc42872f9e2489b8663c3d7d9e2bc7e422102b3 fix Issue 12630 - @nogc should recognize compile-time evaluation context https://github.com/D-Programming-Language/dmd/commit/e3afe41cf289d2cbbeccfdb18b49990ccdfe031e Merge pull request #3493 from 9rnsr/fix12630 Issue 12630 - @nogc should recognize compile-time evaluation context