Unverified Commit 5ca2777c authored by Mark de Wever's avatar Mark de Wever Committed by GitHub
Browse files

[libc++] Fixes valarray proxy type compound assignment operations. (#76528)

The valarray<>::operator[](...) const functions return proxy objects.
The valarray<>::operator[](...) functions return valarray objects.

However the standard allows functions returning valarray objects to
return custom proxy objects instead. Libc++ returns __val_expr proxies.
Functions taking a valarray object must work with the custom proxies
too. Therefore several operations have a custom proxy overload instead
of valarray overloads.

Libc++ doesn't specify a valarray overload. This is an issue with the
standard proxy types; these can implicitly be converted to a valarray.

The solution is to allow the standard proxies to behave as-if they are
custom proxies.

This patch fixes the valarray compound assignments. Other operations,
like the binary non-member functions are not fixed. These will be done
in a followup patch.

Fixes: https://github.com/llvm/llvm-project/issues/21320
parent 47abbf4f
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment