Fix value category bugs in std::reduce
authorJonathan Wakely <jwakely@redhat.com>
Wed, 19 Jun 2019 15:29:49 +0000 (16:29 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Wed, 19 Jun 2019 15:29:49 +0000 (16:29 +0100)
commit74fda2dc9f6198c23da01303a51d06ff69008e31
treecf7d2bc519aa3ce55889d822757c0085f6b61f57
parent4349775a30600906f5811ba7c743a5c22bdb3d7d
Fix value category bugs in std::reduce

* include/std/numeric (reduce(Iter, Iter, T, BinOp)): Fix value
category used in invocable check.
(reduce(Iter, Iter, T)): Pass initial value as rvalue.
* testsuite/26_numerics/reduce/2.cc: New test.

From-SVN: r272477
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/numeric
libstdc++-v3/testsuite/26_numerics/reduce/2.cc [new file with mode: 0644]