D-Programming-Language/dmd — pull request #2311 by 9rnsr (2013-07-07 13:20:30+00:00)
Title: [REG2.064a] Issue 10548 - argument has no identifier

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

This is a supplemental fix for #1102 that had included my small design mistake.

----

The mangled name of function type does not contain default args and parameter types. If function types and its corresponding types (function pointer type, delegate type, etc) gives to template, the template body should not be accessible to the volatile information.

```d
auto fp1 = (int a = 1) {}
auto fp2 = (int b = 2) {}
pragma(msg, typeof(fp1)); // prints "void(int a = 1)"
pragma(msg, typeof(fp2)); // prints "void(int b = 2)"

template X(FP) { pragma(msg, FP); } // should print "void(int)", neither "void(int a = 1)" nor "void(int b = 2)"
alias X1 = X!(typeof(fp1));
alias X2 = X!(typeof(fp2));
static assert(X1.mangleof == X2.mangleof); // X1 and X2 should be identical
```

To implement the behavior, I added stripping volatiles on alias declaration, but it had been not good. Instead we should do it against template type arguments.