D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4108 - ICE(cod2.c): zero-length static array in function call
Summary: ICE(cod2.c): zero-length static array in function call
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2010-04-21 13:45 UTC by bearophile_hugs
Modified: 2014-02-15 02:45 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2010-04-21 13:45:12 UTC
This is D2 code:


void foo(T)(T) {
    bool b = __traits(isStaticArray, T);
}
void main() {
    int[0] arr;
    foo(arr);
}


dmd 2.043 gives at runtime:
Internal error: ..\ztc\cod2.c 4333
Comment 1 Walter Bright 2010-04-27 22:37:47 UTC
The same error is produced by:

  void foo(int[0]);

  void main() {
    int[0] arr;
    foo(arr);
  }

It has nothing to do with __traits.
Comment 2 Walter Bright 2010-04-28 15:12:54 UTC
changeset 459
Comment 3 Don 2010-05-05 19:11:45 UTC
Fixed DMD2.044