[PATCH] D41992: [libcxx] Avoid spurious construction of valarray elements

Mikhail Maltsev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 12 06:34:23 PST 2018


miyuki created this revision.
miyuki added reviewers: EricWF, mclow.lists.

Currently libc++ implements some operations on valarray by using the
resize method. This method has a parameter with a default value.
Because of this, valarray may spuriously construct and destruct
objects of valarray's element type.

      

This patch fixes this issue and adds corresponding test cases.


https://reviews.llvm.org/D41992

Files:
  include/valarray
  test/std/numerics/numarray/template.valarray/valarray.assign/copy_assign.pass.cpp
  test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp
  test/std/numerics/numarray/template.valarray/valarray.cons/default.pass.cpp
  test/std/numerics/numarray/template.valarray/valarray.cons/size.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41992.129617.patch
Type: text/x-patch
Size: 8370 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180112/b9d31e52/attachment-0001.bin>


More information about the cfe-commits mailing list