Bug 15727 – DMD adds default opEqals to structure with SIMD vector
Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-02-26T22:12:55Z
Last change time
2020-03-21T03:56:32Z
Keywords
SIMD
Assigned to
No Owner
Creator
Iakh
Comments
Comment #0 by iaktakh — 2016-02-26T22:12:55Z
This compiles despite there isn't defined opEqals for core.simd vectors
import core.simd;
struct S
{
int4 vec;
}
void main()
{
S a, b;
assert(a == b);
// While this doesn't
//int4 a, b
//assert(a == b);
}
DMD64 D Compiler v2.070
Comment #1 by b2.temp — 2019-11-03T19:31:17Z
This is normal for a struct, a default comparison occurs, i.e on the whole structure. The real issue here is then that vectors of same type cant be compared, and this has been already reported.
*** This issue has been marked as a duplicate of issue 13852 ***