Bug 10497 – Opaque structs cannot be dereferenced in pointer to pointer types
Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-28T11:06:00Z
Last change time
2015-06-09T05:14:49Z
Keywords
rejects-valid
Assigned to
nobody
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2013-06-28T11:06:51Z
-----
module test;
// opaque type
struct S;
void main()
{
S** s;
void* ptr;
*s = cast(S*)ptr; // pointer assignment, not value assignment
}
-----
$ dmd test.d
> test.d(4): Error: struct test.S unknown size
> test.d(4): Error: struct test.S no size yet for forward reference
> test.d(4): Error: struct test.S unknown size
> test.d(4): Error: struct test.S no size yet for forward reference
The size of the structure does not need to be known since what is being assigned is a memory address. It is not a value assign of the struct.
Comment #1 by github-bugzilla — 2013-08-17T23:06:44Z