Currently, trying to do array/vector operations in CTFE causes an ICE. Tests: --- enum int[4] A = [1,2,3,4]; enum int[4] B = [1,2,3,4]; // Internal Compiler Error: non-constant value [1, 2, 3, 4] enum int[4] C = A[] + B[]; import core.simd; enum int4 D = [1,2,3,4]; enum int4 E = [1,2,3,4]; // Internal Compiler Error: non-constant value [1, 2, 3, 4] enum int4 F = D + E;
*** Issue 12401 has been marked as a duplicate of this issue. ***
Add a proper error message at least: https://github.com/dlang/dmd/pull/5706 until a fix can be devised.
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/f571e8a3ee9d460152e43a08dabf96d5ed5d72d9 add error message for Issue 11717 - CTFE: [ICE] non-constant value with array and vector ops https://github.com/dlang/dmd/commit/0a9712f66c2658756f2d69b463e1879c24b3a80c Merge pull request #5706 from WalterBright/address11717 add error message for Issue 11717 - CTFE: [ICE] non-constant value wi…
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/f571e8a3ee9d460152e43a08dabf96d5ed5d72d9 add error message for Issue 11717 - CTFE: [ICE] non-constant value with array and vector ops https://github.com/dlang/dmd/commit/0a9712f66c2658756f2d69b463e1879c24b3a80c Merge pull request #5706 from WalterBright/address11717
Commit pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/5ab26bb7e0dfc0039e80a9bc9d4120af15e18a2f Add error message for Issue 11717
ICE are gone since 2.072
Replacing an ICE with an error is not a fix. Updating tags from ice to rejects-valid.
You should change the title as well. (this is why I closed : the issue was about the ICE. Change the title and it's a complete different thing)
@WalterBright created dlang/dmd pull request #12083 "fix Issue 11717 - CTFE: non-constant value with array and vector ops" fixing this issue: - fix Issue 11717 - CTFE: non-constant value with array and vector ops https://github.com/dlang/dmd/pull/12083
dlang/dmd pull request #12083 "fix Issue 11717 - CTFE: non-constant value with array and vector ops" was merged into master: - 6a958967ccc8261d2095625492e27f22e1078b0b by Walter Bright: fix Issue 11717 - CTFE: non-constant value with array and vector ops https://github.com/dlang/dmd/pull/12083