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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 10 07:10:25 PST 2013


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


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich at gmail.com


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-01-10 07:10:24 PST ---
> // This is invalid because allSatisfy is passed sizes, not I.

I don't think this is invalid because T... accepts aliases. It's not what the
user wants, but it's valid code, e.g.:

template isIntegral(T)
{
    enum bool isIntegral = true;
}

template allSatisfy(alias z, F...)
{
    enum bool allSatisfy = true;
}

void foo(T)(T x, T y)
    if (allSatisfy!(isIntegral, x, y))  // compiles fine
{ }

void main()
{
    foo(1, 2);
}

The stacktrace for OP sample:

0012e340  004a86f7  DMD!halt+0x5(...)
0012e394  004a85d7  DMD!mangle+0x163
0012e3ec  004a87e9  DMD!mangle+0x43
0012e434  0044fa3b  DMD!Declaration::mangle()+0xce(...)
0012e4a0  0044e08d  DMD!TemplateInstance::genIdent(ArrayBase<Object >*)+0x2c0
0012e5a8  0044d93a  DMD!TemplateInstance::semantic(Scope*,ArrayBase<Expression
>*)+0x4d5
0012e5bc  0042995d  DMD!TemplateInstance::semantic(Scope*)+0x14
0012e620  0044791c  DMD!ScopeExp::semantic(Scope*)+0x4a
0012e9b4  004483d1  DMD!+0x1ee6
0012eb84  004339d6 
DMD!TemplateDeclaration::deduceFunctionTemplate(Scope*,Loc,ArrayBase<Object
>*,Expression*,ArrayBase<Expression >*,int )+0x426
0012f050  004809fa  DMD!CallExp::semantic(Scope*)+0x1e18
0012f068  004811de  DMD!ExpStatement::semantic(Scope*)+0x24
0012f25c  004695b9  DMD!CompoundStatement::semantic(Scope*)+0xe5
0012fb00  0049b523  DMD!FuncDeclaration::semantic3(Scope*)+0x1430
0012fb30  00404d29  DMD!Module::semantic3()+0xc3(...)
0012ff44  0040546b  DMD!tryMain+0x281a
0012ff80  00565111  DMD!main+0x43
0012ffc0  7c817067  DMD!mainCRTStartup+0xa9
0012fff0  00000000  0x7c817067

It's some kind of mangling issue.

-- 
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