[Issue 21231] Unreachable warning for empty struct in VariantN with preview=fieldwise

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 10 15:03:31 UTC 2020


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

--- Comment #2 from Dlang Bot <dlang-bot at dlang.rocks> ---
@nordlow created dlang/phobos pull request #7624 "Fieldwise revived" fixing
this issue:

- Fix 21231 - Unreachable warning for empty struct in VariantN...

  ... with preview=fieldwise.

  Equality checks will never fail for instances of empty structs, hence
  don't generate code checking `<` and `>` for them.

  This was exposed by `-preview=fieldwise` which (as a side effect)
  enables dmd to const-fold the aformentioned equality test in the
  frontend.

https://github.com/dlang/phobos/pull/7624

--


More information about the Digitalmars-d-bugs mailing list