www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22515] New: Aggregate definition with qualifiers has


          Issue ID: 22515
           Summary: Aggregate definition with qualifiers has
                    inconsistencies between structs and classes
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: boris2.9 gmail.com


const struct S { }
S s;
static assert(is(S == const));
static assert(is(typeof(s) == const));

const class C { }
C c;
static assert(is(C == const));         // fails
static assert(is(typeof(c) == const)); // fails

Nov 16 2021