[libcxx-commits] [PATCH] D125019: [libc++] Avoid creating temporaries in unary expressions involving valarray

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 30 13:20:34 PDT 2022


ldionne added a comment.

In D125019#3546339 <https://reviews.llvm.org/D125019#3546339>, @ldionne wrote:

> In D125019#3494305 <https://reviews.llvm.org/D125019#3494305>, @philnik wrote:
>
>> Isn't this ABI breaking? Or is it in this case OK for some reason?
>
> It is technically an ABI break. However, the only way I can think of being broken by this is to depend on the exact type of an expression involving `valarray` (such as `decltype(!a && b)`). [...]

It's also worth noting that the Standard does not mandate that the result of `!a` & friends be `std::valarray` itself. Hence, if someone has been relying on that at their ABI boundary, they've been really playing with fire (most likely unknowingly). However, like I said, I think this is unlikely to bite anyone -- one would need an unfortunate combination of `auto`-deduced return types and unary expressions on `valarray` at an ABI boundary to get bitten.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125019



More information about the libcxx-commits mailing list