http://d.puremagic.com/issues/show_bug.cgi?id=8195

           Summary: Segfault when comparing a VariantN to a non-variant
                    type which it holds
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: jmdavisp...@gmx.com


--- Comment #0 from Jonathan M Davis <jmdavisp...@gmx.com> 2012-06-03 21:54:52 
PDT ---
This code:

import std.typetuple;
import std.variant;


struct S
{
    int a;
    long b;
    string c;
    real d;
    bool e;
}

private alias TypeTuple!(string,
                         int,
                         S) Types;


alias VariantN!(maxSize!Types, Types) MyVariant;

void main()
{
    auto v = MyVariant(S.init);
    assert(v == S.init);
}


segfaults when it's run. If you change the assertion to

    assert(v == MyVariant(S.init));

then it runs just fine. This appears to only happen when a struct whose size is
>= Variant.sizeof is in the list of accepted types.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to