llvm-project/libcxx/test/std/numerics/numarray
Louis Dionne b8f6f9e741 [libc++] Avoid creating temporaries in unary expressions involving valarray
Currently, unary expressions involving valarray will create a temporary.
This leads to dangling references in expressions like `-a * b`, because
`-a` is a temporary and the resulting expression will refer to it. This
patch fixes the problem by creating a lazy expression to perform the unary
operation instead of eagerly creating a temporary valarray. This is
permitted by the Standard, which does not specify the exact type of
most expressions involving valarrays.

This is technically an ABI break, however I believe the actual potential
for breakage is very low.

rdar://90152242

Differential Revision: https://reviews.llvm.org/D125019
2022-06-06 12:58:23 -04:00
..
class.gslice
class.slice
template.gslice.array
template.indirect.array
template.mask.array
template.slice.array [libc++] Add slice_array operator= valarray overload. 2020-12-02 10:49:20 -08:00
template.valarray [libc++] Avoid creating temporaries in unary expressions involving valarray 2022-06-06 12:58:23 -04:00
valarray.nonmembers [libc++] Fix result-type and value_type computation in <valarray>. 2021-06-05 12:29:36 -04:00
valarray.range [libc++] [test] Improve the tests for std::{begin,end}(valarray). 2022-03-01 14:24:46 -05:00
valarray.syn