[libcxx-commits] [PATCH] D77505: [libc++] Implement <numbers>

Raul Tambre via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 7 09:45:05 PDT 2020


tambre added inline comments.


================
Comment at: libcxx/test/std/numerics/numbers/non_floating_point.fail.cpp:13-25
+int e{std::numbers::e_v};
+int log2e{std::numbers::log2e_v};
+int log10e{std::numbers::log10e_v};
+int pi{std::numbers::pi_v};
+int inv_pi{std::numbers::inv_pi_v};
+int inv_sqrtpi{std::numbers::inv_sqrtpi_v};
+int ln2{std::numbers::ln2_v};
----------------
rsmith wrote:
> These are all missing their template arguments. I'm not sure exactly what this test is checking for, but I'm assuming it's not that these result in parse errors. (Should these tests omit the `_v` to check for a narrowing conversion, or should they include the `<int>` to check the floating-point constraint?)
This was meant to test "Pursuant to [namespace.std], a program may partially or explicitly specialize a mathematical constant variable template provided that the specialization depends on a program-defined type."
I've removed this test for now, as I'm not sure how to properly test this and if there's even a point.


================
Comment at: libcxx/test/std/numerics/numbers/user_type.pass.cpp:18-30
+user_type e{std::numbers::e_v};
+user_type log2e{std::numbers::log2e_v};
+user_type log10e{std::numbers::log10e_v};
+user_type pi{std::numbers::pi_v};
+user_type inv_pi{std::numbers::inv_pi_v};
+user_type inv_sqrtpi{std::numbers::inv_sqrtpi_v};
+user_type ln2{std::numbers::ln2_v};
----------------
rsmith wrote:
> These are similarly missing their template arguments.
Fixed. Meant to check floating point constraint.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77505/new/

https://reviews.llvm.org/D77505





More information about the libcxx-commits mailing list