[libcxx-commits] [PATCH] D125019: [libc++] Avoid creating temporaries in unary expressions involving valarray

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 5 11:17:43 PDT 2022


Mordante added inline comments.


================
Comment at: libcxx/test/std/numerics/numarray/template.valarray/valarray.unary/bit_not.pass.cpp:59
+        // Make sure we don't have dangling reference problems with unary expressions
+        std::valarray<int> a = {1, 2, 3};
+        std::valarray<int> b = {1, 2, 3};
----------------
C++03 fails due to these initializer lists.


================
Comment at: libcxx/test/std/numerics/numarray/template.valarray/valarray.unary/bit_not.pass.cpp:62
+        auto c = ~a * b;
+        assert(c.size() == 3);
+    }
----------------
Can you also test the contents of the resulting array? Same for the other tests.


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