[Issue 24237] New: BetterC: equality of static arrays fails in betterC
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Nov 9 23:43:55 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=24237
Issue ID: 24237
Summary: BetterC: equality of static arrays fails in betterC
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: betterC, rejects-valid
Severity: major
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: dave287091 at gmail.com
This program fails to compile:
struct Foo {
int x;
}
extern(C)
int main(){
Foo fa, fb;
int x = fa == fb;
Foo[2] a, b;
x += a == b; // Error: expression `a == b` uses the GC and cannot be used
with switch `-betterC`
return x;
}
This should just work, and the idea that `a == b` uses the GC is ridiculous.
--
More information about the Digitalmars-d-bugs
mailing list