Repository: abseil/abseil-cpp

Issue #3: absl/time/duration_test.cc uses isnan/isinf from std namespace w/o qualifier, fails to build w/ gcc 5.4.0
Created: 2017-09-26T15:37:47Z
On Ubuntu 16.04, g++ 5.4.0, libstdc++6 5.4.0, //absl/time:time_test fails to build; duration_test.cc uses isnan and isinf from the std namespace (from cmath) without std:: qualification.

Duplicate issue #10: bazel test fails on ubuntu 16.04
Created: 2017-09-27T04:49:32Z
I'm probably doing something wrong, but following the tutorial, I'm stuck at the bazel test absl/...:all step failing.

  terminal output
~/S/abseil-cpp (master) $ bazel test absl/...:all
INFO: Analysed 94 targets (0 packages loaded).
INFO: Found 40 targets and 54 test targets...
ERROR: /home/pqg/Source/abseil-cpp/absl/time/BUILD.bazel:67:1: C++ compilation of rule '//absl/time:time_test' failed (Exit 1)
In file included from external/com_google_googletest/googletest/include/gtest/gtest.h:58:0,
                 from external/com_google_googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from external/com_google_googletest/googlemock/include/gmock/gmock-actions.h:46,
                 from external/com_google_googletest/googlemock/include/gmock/gmock.h:58,
                 from absl/time/duration_test.cc:22:
absl/time/duration_test.cc: In member function 'virtual void {anonymous}::Duration_InfinityAddition_Test::TestBody()':
absl/time/duration_test.cc:463:38: error: 'isinf' was not declared in this scope
   EXPECT_TRUE(isinf(dbl_inf + dbl_inf));
                                      ^
absl/time/duration_test.cc:463:38: note: suggested alternative:
In file included from absl/time/duration_test.cc:16:0:
/usr/include/c++/5/cmath:621:5: note:   'std::isinf'
     isinf(_Tp __x)
     ^
In file included from external/com_google_googletest/googletest/include/gtest/gtest.h:58:0,
                 from external/com_google_googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from external/com_google_googletest/googlemock/include/gmock/gmock-actions.h:46,
                 from external/com_google_googletest/googlemock/include/gmock/gmock.h:58,
                 from absl/time/duration_test.cc:22:
absl/time/duration_test.cc:464:39: error: 'isnan' was not declared in this scope
   EXPECT_TRUE(isnan(dbl_inf + -dbl_inf));  // We return inf
                                       ^
absl/time/duration_test.cc:464:39: note: suggested alternative:
In file included from absl/time/duration_test.cc:16:0:
/usr/include/c++/5/cmath:641:5: note:   'std::isnan'
     isnan(_Tp __x)
     ^
In file included from external/com_google_googletest/googletest/include/gtest/gtest.h:58:0,
                 from external/com_google_googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from external/com_google_googletest/googlemock/include/gmock/gmock-actions.h:46,
                 from external/com_google_googletest/googlemock/include/gmock/gmock.h:58,
                 from absl/time/duration_test.cc:22:
absl/time/duration_test.cc:465:39: error: 'isnan' was not declared in this scope
   EXPECT_TRUE(isnan(-dbl_inf + dbl_inf));  // We return inf
                                       ^
absl/time/duration_test.cc:465:39: note: suggested alternative:
In file included from absl/time/duration_test.cc:16:0:
/usr/include/c++/5/cmath:641:5: note:   'std::isnan'
     isnan(_Tp __x)
     ^
In file included from external/com_google_googletest/googletest/include/gtest/gtest.h:58:0,
                 from external/com_google_googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from external/com_google_googletest/googlemock/include/gmock/gmock-actions.h:46,
                 from external/com_google_googletest/googlemock/include/gmock/gmock.h:58,
                 from absl/time/duration_test.cc:22:
absl/time/duration_test.cc:466:40: error: 'isinf' was not declared in this scope
   EXPECT_TRUE(isinf(-dbl_inf + -dbl_inf));
                                        ^
absl/time/duration_test.cc:466:40: note: suggested alternative:
In file included from absl/time/duration_test.cc:16:0:
/usr/include/c++/5/cmath:621:5: note:   'std::isinf'
     isinf(_Tp __x)
     ^
In file included from external/com_google_googletest/googletest/include/gtest/gtest.h:58:0,
                 from external/com_google_googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from external/com_google_googletest/googlemock/include/gmock/gmock-actions.h:46,
                 from external/com_google_googletest/googlemock/include/gmock/gmock.h:58,
                 from absl/time/duration_test.cc:22:
absl/time/duration_test.cc: In member function 'virtual void {anonymous}::Duration_InfinitySubtraction_Test::TestBody()':
absl/time/duration_test.cc:500:38: error: 'isnan' was not declared in this scope
   EXPECT_TRUE(isnan(dbl_inf - dbl_inf));  // We return inf
                                      ^
absl/time/duration_test.cc:500:38: note: suggested alternative:
In file included from absl/time/duration_test.cc:16:0:
/usr/include/c++/5/cmath:641:5: note:   'std::isnan'
     isnan(_Tp __x)
     ^
In file included from external/com_google_googletest/googletest/include/gtest/gtest.h:58:0,
                 from external/com_google_googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from external/com_google_googletest/googlemock/include/gmock/gmock-actions.h:46,
                 from external/com_google_googletest/googlemock/include/gmock/gmock.h:58,
                 from absl/time/duration_test.cc:22:
absl/time/duration_test.cc:501:39: error: 'isinf' was not declared in this scope
   EXPECT_TRUE(isinf(dbl_inf - -dbl_inf));
                                       ^
absl/time/duration_test.cc:501:39: note: suggested alternative:
In file included from absl/time/duration_test.cc:16:0:
/usr/include/c++/5/cmath:621:5: note:   'std::isinf'
     isinf(_Tp __x)
     ^
In file included from external/com_google_googletest/googletest/include/gtest/gtest.h:58:0,
                 from external/com_google_googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from external/com_google_googletest/googlemock/include/gmock/gmock-actions.h:46,
                 from external/com_google_googletest/googlemock/include/gmock/gmock.h:58,
                 from absl/time/duration_test.cc:22:
absl/time/duration_test.cc:502:39: error: 'isinf' was not declared in this scope
   EXPECT_TRUE(isinf(-dbl_inf - dbl_inf));
                                       ^
absl/time/duration_test.cc:502:39: note: suggested alternative:
In file included from absl/time/duration_test.cc:16:0:
/usr/include/c++/5/cmath:621:5: note:   'std::isinf'
     isinf(_Tp __x)
     ^
In file included from external/com_google_googletest/googletest/include/gtest/gtest.h:58:0,
                 from external/com_google_googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from external/com_google_googletest/googlemock/include/gmock/gmock-actions.h:46,
                 from external/com_google_googletest/googlemock/include/gmock/gmock.h:58,
                 from absl/time/duration_test.cc:22:
absl/time/duration_test.cc:503:40: error: 'isnan' was not declared in this scope
   EXPECT_TRUE(isnan(-dbl_inf - -dbl_inf));  // We return inf
                                        ^
absl/time/duration_test.cc:503:40: note: suggested alternative:
In file included from absl/time/duration_test.cc:16:0:
/usr/include/c++/5/cmath:641:5: note:   'std::isnan'
     isnan(_Tp __x)
     ^
In file included from external/com_google_googletest/googletest/include/gtest/gtest.h:58:0,
                 from external/com_google_googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from external/com_google_googletest/googlemock/include/gmock/gmock-actions.h:46,
                 from external/com_google_googletest/googlemock/include/gmock/gmock.h:58,
                 from absl/time/duration_test.cc:22:
absl/time/duration_test.cc: In member function 'virtual void {anonymous}::Duration_InfinityIDiv_Test::TestBody()':
absl/time/duration_test.cc:711:38: error: 'isnan' was not declared in this scope
   EXPECT_TRUE(isnan(dbl_inf / dbl_inf));
                                      ^
absl/time/duration_test.cc:711:38: note: suggested alternative:
In file included from absl/time/duration_test.cc:16:0:
/usr/include/c++/5/cmath:641:5: note:   'std::isnan'
     isnan(_Tp __x)
     ^
In file included from external/com_google_googletest/googletest/include/gtest/gtest.h:58:0,
                 from external/com_google_googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from external/com_google_googletest/googlemock/include/gmock/gmock-actions.h:46,
                 from external/com_google_googletest/googlemock/include/gmock/gmock.h:58,
                 from absl/time/duration_test.cc:22:
absl/time/duration_test.cc:717:34: error: 'isinf' was not declared in this scope
   EXPECT_TRUE(isinf(dbl_inf / 2.0));
                                  ^
absl/time/duration_test.cc:717:34: note: suggested alternative:
In file included from absl/time/duration_test.cc:16:0:
/usr/include/c++/5/cmath:621:5: note:   'std::isinf'
     isinf(_Tp __x)
     ^
In file included from external/com_google_googletest/googletest/include/gtest/gtest.h:58:0,
                 from external/com_google_googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from external/com_google_googletest/googlemock/include/gmock/gmock-actions.h:46,
                 from external/com_google_googletest/googlemock/include/gmock/gmock.h:58,
                 from absl/time/duration_test.cc:22:
absl/time/duration_test.cc: In member function 'virtual void {anonymous}::Duration_DivisionByZero_Test::TestBody()':
absl/time/duration_test.cc:766:28: error: 'isinf' was not declared in this scope
   EXPECT_TRUE(isinf(two / z));
                            ^
absl/time/duration_test.cc:766:28: note: suggested alternative:
In file included from absl/time/duration_test.cc:16:0:
/usr/include/c++/5/cmath:621:5: note:   'std::isinf'
     isinf(_Tp __x)
     ^
In file included from external/com_google_googletest/googletest/include/gtest/gtest.h:58:0,
                 from external/com_google_googletest/googlemock/include/gmock/internal/gmock-internal-utils.h:47,
                 from external/com_google_googletest/googlemock/include/gmock/gmock-actions.h:46,
                 from external/com_google_googletest/googlemock/include/gmock/gmock.h:58,
                 from absl/time/duration_test.cc:22:
absl/time/duration_test.cc:767:26: error: 'isnan' was not declared in this scope
   EXPECT_TRUE(isnan(z / z));  // We'll return inf
                          ^
absl/time/duration_test.cc:767:26: note: suggested alternative:
In file included from absl/time/duration_test.cc:16:0:
/usr/include/c++/5/cmath:641:5: note:   'std::isnan'
     isnan(_Tp __x)
     ^
At global scope:
cc1plus: warning: unrecognized command line option '-Wno-unused-private-field'
INFO: Elapsed time: 1.912s, Critical Path: 1.63s
FAILED: Build did NOT complete successfully
//absl/algorithm:algorithm_test                                 (cached) PASSED in 0.1s
//absl/algorithm:container_test                                 (cached) PASSED in 0.1s
//absl/base:bit_cast_test                                       (cached) PASSED in 0.1s
//absl/base:call_once_test                                      (cached) PASSED in 0.1s
//absl/base:config_test                                         (cached) PASSED in 0.1s
//absl/base:endian_test                                         (cached) PASSED in 0.4s
//absl/base:invoke_test                                         (cached) PASSED in 0.1s
//absl/base:low_level_alloc_test                                (cached) PASSED in 7.5s
//absl/base:malloc_extension_system_malloc_test                 (cached) PASSED in 0.1s
//absl/base:raw_logging_test                                    (cached) PASSED in 0.3s
//absl/base:spinlock_test                                       (cached) PASSED in 0.3s
//absl/base:sysinfo_test                                        (cached) PASSED in 0.1s
//absl/base:thread_identity_test                                (cached) PASSED in 0.1s
//absl/base:throw_delegate_test                                 (cached) PASSED in 0.1s
//absl/container:fixed_array_test                               (cached) PASSED in 2.3s
//absl/container:fixed_array_test_noexceptions                  (cached) PASSED in 2.2s
//absl/container:inlined_vector_test                            (cached) PASSED in 0.2s
//absl/container:inlined_vector_test_noexceptions               (cached) PASSED in 0.2s
//absl/container:test_instance_tracker_test                     (cached) PASSED in 0.1s
//absl/debugging:disabled_leak_check_test                       (cached) PASSED in 0.1s
//absl/debugging:leak_check_no_lsan_test                        (cached) PASSED in 0.1s
//absl/debugging:leak_check_test                                (cached) PASSED in 0.1s
//absl/memory:memory_test                                       (cached) PASSED in 0.1s
//absl/meta:type_traits_test                                    (cached) PASSED in 0.1s
//absl/numeric:int128_test                                      (cached) PASSED in 0.3s
//absl/types:any_test                                           (cached) PASSED in 0.1s
//absl/types:any_test_noexceptions                              (cached) PASSED in 0.1s
//absl/types:optional_test                                      (cached) PASSED in 0.1s
//absl/types:span_test                                          (cached) PASSED in 0.0s
//absl/types:span_test_noexceptions                             (cached) PASSED in 0.1s
//absl/utility:utility_test                                     (cached) PASSED in 0.1s
//absl/strings:ascii_test                                             NO STATUS
//absl/strings:char_map_test                                          NO STATUS
//absl/strings:escaping_test                                          NO STATUS
//absl/strings:match_test                                             NO STATUS
//absl/strings:memutil_test                                           NO STATUS
//absl/strings:numbers_test                                           NO STATUS
//absl/strings:ostringstream_test                                     NO STATUS
//absl/strings:resize_uninitialized_test                              NO STATUS
//absl/strings:str_cat_test                                           NO STATUS
//absl/strings:str_join_test                                          NO STATUS
//absl/strings:str_replace_test                                       NO STATUS
//absl/strings:str_split_test                                         NO STATUS
//absl/strings:string_view_test                                       NO STATUS
//absl/strings:strip_test                                             NO STATUS
//absl/strings:substitute_test                                        NO STATUS
//absl/strings:utf8_test                                              NO STATUS
//absl/synchronization:barrier_test                                   NO STATUS
//absl/synchronization:blocking_counter_test                          NO STATUS
//absl/synchronization:graphcycles_test                               NO STATUS
//absl/synchronization:mutex_test                                     NO STATUS
//absl/synchronization:notification_test                              NO STATUS
//absl/synchronization:per_thread_sem_test                            NO STATUS
Executed 0 out of 54 tests: 31 tests pass, 1 fails to build and 22 were skipped.
There were tests whose specified size is too big. Use the --test_verbose_timeout_warnings command line option to see which ones these are.
/S/abseil-cpp (master) $ c++ --version
c++ (Ubuntu 5.4.0-6ubuntu116.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
~/S/abseil-cpp (master) $


And versions of things:
~/S/abseil-cpp (master) $ bazel version
Build label: 0.5.4
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Aug 25 10:00:00 2017 (1503655200)
Build timestamp: 1503655200
Build timestamp as int: 1503655200

~/S/abseil-cpp (master) $ g++ --version
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Closing comment (2017-09-27T12:34:48Z): This is a duplicate of #3.