[libcxx-commits] [libcxx] [libc++] Constrain additional overloads of `pow` for `complex` harder (PR #110235)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 21 23:59:30 PDT 2024


frederick-vs-ja wrote:

> FWIW I'd be more in favour of simply removing the `static_assert` again, since I've only added it because I thought that was a requirement before my change.

Hmm... Just removing `static_assert` doesn't make `__promote` SFINAE-friendly, and will make the error messages worse for the case in #109858.

In libc++, we generally constrain the additional overloads (in `<cmath>`) that use `__promote` to accept only arithmetic types. But currently we are not doing so for `pow` overloads for `complex`, so hard error can raise from them.

https://github.com/llvm/llvm-project/pull/110235


More information about the libcxx-commits mailing list