int ctfeFun(const int[] arr) { auto startp = arr.ptr; auto endp = arr.ptr + arr.length; for(; startp < endp; startp++) {} return 0; } const arr = [1, 2, 3]; enum ans = ctfeFun(arr); test9.d(5): Error: pointer expression startp++ cannot be interpreted at compile time test9.d(11): Error: cannot evaluate ctfeFun(arr) at compile time Changing startp++ to ++startp fixes the problem.
I can confirm it. But in my case it's 'p--' which cannot be interpreted at compile-time, when ++p somewhere in the code works just fine. 'p' is 'const(char)*'.
https://github.com/D-Programming-Language/dmd/commit/563a291a5c7757fca87685909afa37100e3b44f6