[Issue 3076] New: ICE[ztc\cod1.c:1673] - Compiler doesn't care about struct types in initializers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 17 20:15:40 PDT 2009


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

           Summary: ICE[ztc\cod1.c:1673] - Compiler doesn't care about
                    struct types in initializers
           Product: D
           Version: 1.042
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid, ice-on-invalid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: jarrett.billingsley at gmail.com


The compiler doesn't seem to care if you initialize a struct variable with a
struct of an incorrect type.  Maybe it's supposed to be checking for a static
opCall but fails to diagnose an error when it fails to find one?

struct A {}
struct B {}
A a = B(); // accepted!
a = B(); // properly flagged as an error

This can lead to the ICE mentioned in the description, if the source type is
smaller than the destination, at least for some values of "smaller," *and* the
source is a function call.  The following, for instance, causes it:

struct Small { uint x; }
struct Large { uint x, y, z; }
Small foo() { return Small(); }
void main() { Large l = foo(); } // bang!

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