[PATCH] D146329: [Clang] Fix defaulted equality operator so that it does not attempt to compare unnamed bit-fields

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 3 21:06:06 PDT 2023


shafik added a comment.

In D146329#4207522 <https://reviews.llvm.org/D146329#4207522>, @royjacobson wrote:

> In D146329#4203174 <https://reviews.llvm.org/D146329#4203174>, @shafik wrote:
>
>> I would have loved to test the case from https://github.com/llvm/llvm-project/issues/61335 directly but I think in order to do it nicely I need `__builtin_memset` to be usable in a constant expression context. I will add this to my todo list. I am open to other alternatives for testing this.
>
> I managed to generate relatively readable LLVM IR for this: https://godbolt.org/z/z1YzoEcr3 (the generated equality operators are obviously not correct yet), I think matching against that is testing the issue pretty well.
>
> (The trick to making it readable was turning on optimization, though. Not sure if we usually do that)

I think in general we can't rely on optimizations in test like this but wdyt @erichkeane


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146329/new/

https://reviews.llvm.org/D146329



More information about the cfe-commits mailing list