[Issue 6538] ICE(mangle.c) Invalid template constraints

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 22 17:23:52 PST 2013


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



--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> 2013-01-22 17:23:50 PST ---
> void foo(I...)(I sizes)
> if (allSatisfy!(isIntegral, sizes)) {}

In this case, allSatisfy is instantiated with the symbol 'sizes', but it does
not have an actual entity so foo is not yet instantiated. When a template is
instantiated, its symbol arguments must have valid mangled names, but in this
case, 'sizes' cannot have that. So this is an ice-on-invalid bug.

And also, bug 9361 is a special case of this bug.

struct Unit(A)
{
    void butPleaseDontUseMe()()
    if (is(unitType!((this))))  // !
    {}

}
template isUnit(alias T) if ( is(T)) {}
template isUnit(alias T) if (!is(T)) {}
template unitType(alias T) if (isUnit!T) {}
void main()
{
    Unit!int u;
    u.butPleaseDontUseMe();     // crashes
}

In the template constraint for the member function template, 'this' expression
is also a *pseudo* symbol as same as the function parameters. So, taking them
through alias template parameter should be rejected.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list