[Issue 9244] New: union containing pointers not allowed
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Dec 29 20:40:57 PST 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9244
Summary: union containing pointers not allowed
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: rtcvb32 at yahoo.com
--- Comment #0 from Era Scarecrow <rtcvb32 at yahoo.com> 2012-12-29 20:40:55 PST ---
Silently enters 'void* this;' pointer making compiling error out. Current beta
(v2.061, windows 32bit)
Only by using traits will the problem show itself.
[code]
static assert(__traits(compiles, {
union xxx {
int i;
//bitfields will make such functions...
mixin("int geti() @safe const nothrow pure {return i;}void seti(int ii)
@safe pure nothrow {i = ii;}");
}
}));
[/code]
output:
test.d(??): Error: static assert (__traits(compiles,delegate pure nothrow
@safe void()
{
union xxx
{
int i;
mixin("int geti() @safe const nothrow pure {return i;}void seti(int ii) @safe
pure nothrow {i = ii;}");
void* this;
}
}
)) is false
--
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