--- Comment #6 from Steven Schveighoffer <> 2011-03-03 
07:16:34 PST ---
With some testing, I discovered that it's the act of explicit instantiation
that causes the line number to be tied to the declaration line:

ptrdiff_t Test1(string name, string file = __FILE__, ptrdiff_t line =
    pragma(msg, line.stringof);
    return line ;

void main(){
    auto test1 = Test1!("test")();

prints 1.

This workaround does work:

Test2!(file, line) createTest2(string file = __FILE__, ptrdiff_t line =
   return new Test2!(file line);

I agree with the request that the line number and file should be tied to the
instantiation line, not the declaration line.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to