[Issue 2706] invalid template instantiation (and declaration?) is not rejected

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 2 20:45:23 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2706





------- Comment #2 from tomas at famolsen.dk  2009-03-02 22:45 -------
Ok the second one makes a little sense. but what about this one:

template newTB(char[] c, char[] d)
{
    const newTB = mixin(c~"+"~d);
}

int a=1, b=2;

void main()
{
    auto c = newTB!("a", "b");
    printf("%d\n", c);
    a = 4;
    b = 6;
    c = newTB!("a", "b");
    printf("%d\n", c);
}

extern(C) int printf(char*, ...);

/*
[tomas at myhost tests]$ dmd bar.d
[tomas at myhost tests]$ ./bar
3
10
*/

?


-- 



More information about the Digitalmars-d-bugs mailing list