[Issue 13303] New: "Internal error: ..\ztc\cgcs.c 351" with rvalue Variant.get call

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Aug 15 16:08:30 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13303

          Issue ID: 13303
           Summary: "Internal error: ..\ztc\cgcs.c 351" with rvalue
                    Variant.get call
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ice
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: thecybershadow at gmail.com

////// test.d /////
import std.variant;

struct S {}

Variant value();

void test()
{
    value.get!S;
}
///////////////////

This is a Phobos regression which uncovered a DMD ICE;
introduced in: https://github.com/D-Programming-Language/phobos/pull/2147

Although the bug is in the compiler, the regression is caused by a change in
Phobos.

Full reduction:

/////// test.d ///////
struct Variant
{
    ~this()
    {
    }

    @property get(T)()
    {
        union Buf { }
        Buf buf;
        return buf;
    }
}

struct S {}

Variant value();

void test()
{
    value.get!S;
}
//////////////////////

--


More information about the Digitalmars-d-bugs mailing list