[libcxx-commits] [PATCH] D125019: [libc++] Avoid creating temporaries in unary expressions involving valarray
Hubert Tong via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon May 30 18:05:13 PDT 2022
hubert.reinterpretcast added a comment.
In D125019#3546352 <https://reviews.llvm.org/D125019#3546352>, @ldionne wrote:
> 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.
Wouldn't one be also bitten if they explicitly instantiated an instance of `valarray` with a program-defined type and made the instantiated member functions available as part of their ABI interface?
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