Re: [libcxx] r271060 - Tolerate incorrect return type for 'isinf' and 'isnan' in tests.

2016-05-28 Thread Richard Smith via cfe-commits
On 28 May 2016 12:58 a.m., "Eric Fiselier via cfe-commits" <
cfe-commits@lists.llvm.org> wrote:
>
> I think that would be a possibility. However IMO such a change has little
value. Unlike other uses of `_LIBCPP_PREFERRED_OVERLOAD`, which fix const
correctness issue, I don't think the int vs bool return type distinction as
that important. Perhaps I"m just being ignorant?

I don't think it's likely to be particularly important, but it seems pretty
easy for us to fix with the techniques we're using elsewhere.

> /Eric
>
> ___
> cfe-commits mailing list
> cfe-commits@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libcxx] r271060 - Tolerate incorrect return type for 'isinf' and 'isnan' in tests.

2016-05-28 Thread Eric Fiselier via cfe-commits
I think that would be a possibility. However IMO such a change has little
value. Unlike other uses of `_LIBCPP_PREFERRED_OVERLOAD`, which fix const
correctness issue, I don't think the int vs bool return type distinction as
that important. Perhaps I"m just being ignorant?

/Eric
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [libcxx] r271060 - Tolerate incorrect return type for 'isinf' and 'isnan' in tests.

2016-05-28 Thread Richard Smith via cfe-commits
Could we use __LIBCPP_PREFERRED_OVERLOAD to get this working even with
older glibc (and recent clang)?

On 27 May 2016 3:26 p.m., "Eric Fiselier via cfe-commits" <
cfe-commits@lists.llvm.org> wrote:

> Author: ericwf
> Date: Fri May 27 17:19:53 2016
> New Revision: 271060
>
> URL: http://llvm.org/viewvc/llvm-project?rev=271060=rev
> Log:
> Tolerate incorrect return type for 'isinf' and 'isnan' in tests.
>
> Summary:
> GLIBC recently removed the incorrect `int isinf(double)` and `int
> isnan(double)` overloads in C++11 and greater. This causes previously
> `XFAIL: linux`  tests to start passing.
>
> Since there is no longer a way to 'XFAIL' the tests I choose to simply
> tolerate this bug.
>
> See https://sourceware.org/bugzilla/show_bug.cgi?id=19439
>
>
> Reviewers: rsmith, mclow.lists, EricWF
>
> Subscribers: jroelofs, cfe-commits
>
> Differential Revision: http://reviews.llvm.org/D19835
>
> Removed:
> libcxx/trunk/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp
> libcxx/trunk/test/std/depr/depr.c.headers/math_h_isnan.pass.cpp
> libcxx/trunk/test/std/numerics/c.math/cmath_isinf.pass.cpp
> libcxx/trunk/test/std/numerics/c.math/cmath_isnan.pass.cpp
> Modified:
> libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp
> libcxx/trunk/test/std/numerics/c.math/cmath.pass.cpp
>
> Modified: libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp?rev=271060=271059=271060=diff
>
> ==
> --- libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp (original)
> +++ libcxx/trunk/test/std/depr/depr.c.headers/math_h.pass.cpp Fri May 27
> 17:19:53 2016
> @@ -9,9 +9,6 @@
>
>  // 
>
> -// NOTE: isinf and isnan are tested separately because they are expected
> to fail
> -// on linux. We don't want their expected failure to hide other failures
> in this file.
> -
>  #include 
>  #include 
>  #include 
> @@ -631,6 +628,29 @@ void test_isgreaterequal()
>  assert(isgreaterequal(-1.0, 0.F) == false);
>  }
>
> +void test_isinf()
> +{
> +#ifdef isinf
> +#error isinf defined
> +#endif
> +static_assert((std::is_same::value),
> "");
> +
> +typedef decltype(isinf((double)0)) DoubleRetType;
> +#ifndef __linux__
> +static_assert((std::is_same::value), "");
> +#else
> +// GLIBC < 2.26 defines 'isinf(double)' with a return type of 'int' in
> +// all C++ dialects. The test should tolerate this.
> +// See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439
> +static_assert((std::is_same::value
> +|| std::is_same::value), "");
> +#endif
> +
> +static_assert((std::is_same::value), "");
> +static_assert((std::is_same bool>::value), "");
> +assert(isinf(-1.0) == false);
> +}
> +
>  void test_isless()
>  {
>  #ifdef isless
> @@ -688,6 +708,29 @@ void test_islessgreater()
>  assert(islessgreater(-1.0, 0.F) == true);
>  }
>
> +void test_isnan()
> +{
> +#ifdef isnan
> +#error isnan defined
> +#endif
> +static_assert((std::is_same::value),
> "");
> +
> +typedef decltype(isnan((double)0)) DoubleRetType;
> +#ifndef __linux__
> +static_assert((std::is_same::value), "");
> +#else
> +// GLIBC < 2.26 defines 'isnan(double)' with a return type of 'int' in
> +// all C++ dialects. The test should tolerate this.
> +// See: https://sourceware.org/bugzilla/show_bug.cgi?id=19439
> +static_assert((std::is_same::value
> +|| std::is_same::value), "");
> +#endif
> +
> +static_assert((std::is_same::value), "");
> +static_assert((std::is_same bool>::value), "");
> +assert(isnan(-1.0) == false);
> +}
> +
>  void test_isunordered()
>  {
>  #ifdef isunordered
> @@ -1443,9 +1486,11 @@ int main()
>  test_isnormal();
>  test_isgreater();
>  test_isgreaterequal();
> +test_isinf();
>  test_isless();
>  test_islessequal();
>  test_islessgreater();
> +test_isnan();
>  test_isunordered();
>  test_acosh();
>  test_asinh();
>
> Removed: libcxx/trunk/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp?rev=271059=auto
>
> ==
> --- libcxx/trunk/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp
> (original)
> +++ libcxx/trunk/test/std/depr/depr.c.headers/math_h_isinf.pass.cpp
> (removed)
> @@ -1,30 +0,0 @@
>
> -//===--===//
> -//
> -// The