Quuxplusone / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
https://p1144.godbolt.org/z/jf67zx5hq
Other
1 stars 2 forks source link

Error on `unexpected(1) == unexpected(1L)` #40

Closed Quuxplusone closed 1 week ago

Quuxplusone commented 3 weeks ago

https://godbolt.org/z/a8rPnKz1Y

#include <expected>
static_assert(std::unexpected(1) == std::unexpected(1L));

__expected/unexpected.h:111:31: error: '__unex_' is a private member of 'std::unexpected<long>'
  111 |     return __x.__unex_ == __y.__unex_;
      |                               ^

The fix is to use __y.error() instead of __y.__unex_.

(attn: @huixie90)

frederick-vs-ja commented 2 weeks ago

I'm taking this.

ldionne commented 2 weeks ago

@Quuxplusone Some people may not be aware that you are affected by a ban from the LLVM community and what the process for handling this is (https://llvm.org/docs/DeveloperPolicy.html#bans), which can effectively lead people into breaking the LLVM Developer Policy without even knowing about it. I don't think that is your intention, but that's effectively what's happening.

For anyone reading: the process for handling contributions from a banned individual is laid out in https://llvm.org/docs/DeveloperPolicy.html#bans. It is important to avoid proxying communication for a banned individual (which would effectively circumvent their ban). Of course, that doesn't mean that we must ignore the existence of any such contribution (e.g. do as-if there was no bug in libc++ since it came from someone affected by a ban) -- that would make no sense. Instead, one must take full ownership and responsibility of the contribution, which I did in https://github.com/llvm/llvm-project/issues/115326. For any questions about what to do in these special situations, please contact the LLVM Code of Conduct committee -- I don't make the rules, they do.

I really don't like policing around, but I think it's better to have everything written down and clear than having a libc++ contributor be violating the developer policy without even knowing it.

Quuxplusone commented 2 weeks ago

@ldionne Yep, the current situation is regrettable; but it's Tanya's world, I just live in it. :) My many thanks to @frederick-vs-ja for stepping up.

Quuxplusone commented 1 week ago

Fixed in llvm#115249!