Summary: Unclear semantics of template value parameters
           Product: D
           Version: 2.025
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid, spec
          Severity: normal
          Priority: P2
         Component: DMD

The following code compiles but the generated binary is not correct.

import std.stdio;

void foo(string s)()

void main()
    string s = "test";
Prints nothing. In less trivial cases, passing non-const arguments to value
parameters causes data corruption/access violations.

It is not defined whether the argument should be passed by alias or the code
should fail to compile complaining about the argument not being evaluatable at
compile time.


Reply via email to