[PATCH] D25403: [CUDA] Mark __libcpp_{isnan, isinf, isfinite} as constexpr.

Justin Lebar via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 15 10:50:10 PST 2016


jlebar added a comment.

Thanks for the review.



================
Comment at: libcxx/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp:17
+// true constexpr-ness.
+
+#include <cmath>
----------------
EricWF wrote:
> Does GCC offer these as contexpr? If not this needs a `// XFAIL: gcc`
Looks like the relevant builtins in gcc are constexpr-evaluatable: https://godbolt.org/g/GcwJba


================
Comment at: libcxx/test/libcxx/numerics/c.math/constexpr-fns.pass.cpp:22
+
+#ifndef _LIBCPP_VERSION
+#error _LIBCPP_VERSION not defined
----------------
EricWF wrote:
> You don't need this `_LIBCPP_VERSION` check here.
Hm, there are lots of tests that have this, and since this test will not compile with libstdc++, if it's not appropriate here, I am confused as to when we should and shouldn't have this check.  When should it be used?


https://reviews.llvm.org/D25403





More information about the cfe-commits mailing list