[libcxx-commits] [libcxx] [libc++] Verifies std::forward_like's mandates clause. (PR #127318)
A. Jiang via libcxx-commits
libcxx-commits at lists.llvm.org
Sun Feb 23 18:18:12 PST 2025
frederick-vs-ja wrote:
> > > Can't we test all of this with SFINAE tests instead?
> >
> >
> > I don't think we can. With SFINAE we test a constraint clause and this is a mandates clause.
>
> Yeah, I'm actually not convinced this is "nothing to do". We're currently SFINAEing away AFAICT, but the standard asks us to reject the code out right.
Since there's only one `std::forward_like` overload in the standard library (true for both standard wording and implementations), as long as one writes `std::forward_like`, it's not observable whether _Mandates_ is implemented in the same way as _Constraints_.
It's not very clear to me what should happen when user-provided overloads are involved...
https://github.com/llvm/llvm-project/pull/127318
More information about the libcxx-commits
mailing list