www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23443] New: Cannot compare structs with vector fields for

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

          Issue ID: 23443
           Summary: Cannot compare structs with vector fields for equality
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

As reported by Iain Buclaw
https://github.com/dlang/dmd/pull/14597#issuecomment-1294748189

alias int4 = __vector(int[4]);
struct S4 { int i; int4 v; float f; }
bool eq(S4 a, S4 b)
{
    return a == b;
}

The error is:

Error: expression `a.v == b.v` of type `__vector(int[4])` does not have a
boolean value

--
Oct 29 2022