D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3635 - Arrays of pointers to forward declared structs fail to compile
Summary: Arrays of pointers to forward declared structs fail to compile
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2009-12-19 19:53 UTC by siegelords_abode
Modified: 2015-06-09 05:11 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 siegelords_abode 2009-12-19 19:53:40 UTC
Arrays of pointers to forward declared structs issue compile-time errors in dmd 1.053 (and possibly others). Code to reproduce this bug:

struct Struct;

void main()
{
   Struct*[] arr;
   arr.length = 1;
}

Workabouts:
Use an associative array.
Declare struct as struct Struct {}; (might not be foolproof, but works for me)
Comment 1 hsteoh 2014-11-18 04:46:41 UTC
Tested on git HEAD, Linux/64. Could not reproduce compile errors. Please reopen if the problem still exists on other platforms / test cases.