Issue 11376 - ICE on __traits(compiles, ...) with invalid array-op
Summary: ICE on __traits(compiles, ...) with invalid array-op
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 major
Assignee: No Owner
URL:
Keywords: ice, pull
Depends on:
Blocks:
 
Reported: 2013-10-29 03:50 UTC by John Colvin
Modified: 2013-11-30 08:38 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description John Colvin 2013-10-29 03:50:13 UTC
//arrayTest.d
template I(T ...)
{
    alias I = T;
}

auto sumArrs(T0, T1)(T0[] a, T1[] b)
{
    a[] += b[]; //no ICE without this line
    return a;
}

pragma(msg, __traits(compiles, sumArrs(I!(string[], string).init)));



$dmd arrayTest.d
false
Statement::toCBuffer()

Internal error: s2ir.c 135



This is a very heavy reduced test-case from a much larger program. The original __traits(compiles, ...) was in a static if, not a pragma(msg, ...)
Comment 2 github-bugzilla 2013-11-07 22:27:46 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/38a4d2e7e7514e8e2cacaf3dd4393b914e5563d2
fix Issue 11376 - ICE on __traits(compiles, ...) with invalid array-op

https://github.com/D-Programming-Language/dmd/commit/864fcda2b9635b5d24c6ef55813f4c2575984744
Merge pull request #2706 from 9rnsr/fix11376

Issue 11376 - ICE on __traits(compiles, ...) with invalid array-op