[Issue 10995] New: [REG]CTFE failures for structs with void initialized members

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 8 02:56:38 PDT 2013


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

           Summary: [REG]CTFE failures for structs with void initialized
                    members
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: monarchdodra at gmail.com


--- Comment #0 from monarchdodra at gmail.com 2013-09-08 02:56:35 PDT ---
Regression 2.063.2 => 2.064-devel

Possibly related (or even the root cause) of 10994:
http://d.puremagic.com/issues/show_bug.cgi?id=10994

Let T be a struct with a void initialized member:

REG 1:
//----
struct T
{
    short a = void;
}
enum i = T.init.a;
//----
main.d(5): Error: cannot read uninitialized variable T().a in ctfe
main.d(3): Error: variable main.T.a was uninitialized and used before set

REG2:
This one is more problematic, as there would seem to be some type system
corruption:

//----
struct T
{
    short a = void;
}

T foo()
{
    auto t = T.init;
    return t;
}

enum i = foo().a;
//----
main.d(12): Error: couldn't find field a in short
//----

Apparently, doing the call ".a" "transforms" the type of "foo()" to "a's" type,
giving the cryptic error message. Or something.

############################
Both these cases passed in 2.063.2.
Both these cases pass if a is not declared void-initialized.

-- 
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