[PATCH] D40651: Implement most of P0451 - Constexpr for std::complex

Marshall Clow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 30 07:22:04 PST 2017


mclow.lists created this revision.

This patch implements most of https://wg21.link/P0451r1 - the notable exception being division.
The current implementation of complex division in libc++ uses `logb`, `fmax`, and a couple of other primitives that are not constexpr. The paper has some approaches for dealing with this, but I haven't implemented those yet. I wanted to get all the mechanical bits out first.

Note that there are tests for division being constexpr; they currently fail.


https://reviews.llvm.org/D40651

Files:
  include/complex
  test/std/numerics/complex.number/complex.member.ops/assignment_scalar.pass.cpp
  test/std/numerics/complex.number/complex.member.ops/divide_equal_scalar.pass.cpp
  test/std/numerics/complex.number/complex.member.ops/minus_equal_scalar.pass.cpp
  test/std/numerics/complex.number/complex.member.ops/plus_equal_scalar.pass.cpp
  test/std/numerics/complex.number/complex.member.ops/times_equal_scalar.pass.cpp
  test/std/numerics/complex.number/complex.members/real_imag.pass.cpp
  test/std/numerics/complex.number/complex.ops/complex_divide_complex.pass.cpp
  test/std/numerics/complex.number/complex.ops/complex_divide_scalar.pass.cpp
  test/std/numerics/complex.number/complex.ops/complex_minus_complex.pass.cpp
  test/std/numerics/complex.number/complex.ops/complex_plus_complex.pass.cpp
  test/std/numerics/complex.number/complex.ops/complex_plus_scalar.pass.cpp
  test/std/numerics/complex.number/complex.ops/complex_times_complex.pass.cpp
  test/std/numerics/complex.number/complex.ops/complex_times_scalar.pass.cpp
  test/std/numerics/complex.number/complex.ops/scalar_divide_complex.pass.cpp
  test/std/numerics/complex.number/complex.ops/scalar_minus_complex.pass.cpp
  test/std/numerics/complex.number/complex.ops/scalar_plus_complex.pass.cpp
  test/std/numerics/complex.number/complex.ops/scalar_times_complex.pass.cpp
  test/std/numerics/complex.number/complex.ops/unary_minus.pass.cpp
  test/std/numerics/complex.number/complex.ops/unary_plus.pass.cpp
  test/std/numerics/complex.number/complex.value.ops/conj.pass.cpp
  test/std/numerics/complex.number/complex.value.ops/imag.pass.cpp
  test/std/numerics/complex.number/complex.value.ops/norm.pass.cpp
  test/std/numerics/complex.number/complex.value.ops/proj.pass.cpp
  test/std/numerics/complex.number/complex.value.ops/real.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40651.124934.patch
Type: text/x-patch
Size: 59622 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171130/5eb937d2/attachment-0001.bin>


More information about the cfe-commits mailing list