Errors building test/future.cpp with Apple Xcode 8 and 9

Issue #335 resolved
Paul Hargrove created an issue

In performing pre-merge CI on pull request 181, I discovered that clang++ from Apple Xcode 8 (el-capitan VM) and 9 (old-high-sierra laptop, and presumably others) are failing with a static_assert in <tuple> when building test/future.cpp.

Our Clang floor is OK on Linux/x86_64 (Dirac) and recent Xcode (10.3 and 11.3) are OK.

The error:

[external-upcxx/future-seq] FAILED: expect pass but got error   (NEW)
cd /usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/gasnet/tests/upcr-harness/external-upcxx
/usr/bin/make UPCXX_CODEMODE=debug UPCC='/usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/inst/bin/upcc -g  --network=smp ' NETWORK=smp UPCC_STAT_THREADS='-T '  future-seq
+ /Applications/Xcode.app/Contents/Developer/usr/bin/make wrap_test TEST_PATH=/usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/upcxx/test/future.cpp TEST_EXE=future-seq
+ :
+ /usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/upcxx-inst/bin/upcxx -o future-seq /usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/upcxx/test/future.cpp
In file included from /usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/upcxx/test/future.cpp:2:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue:169:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque:158:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer:7:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:628:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:609:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:221:10: error: static_assert failed "Attempted to construct a reference element in a tuple with an rvalue"
        {static_assert(!is_reference<_Hp>::value ||
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:437:15: note: in instantiation of function template specialization 'std::__1::__tuple_leaf<0, const int &, false>::__tuple_leaf<int, void>' requested here
            : __tuple_leaf<_Indx, _Tp>(_VSTD::forward<typename tuple_element<_Indx,
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:662:15: note: in instantiation of function template specialization 'std::__1::__tuple_impl<std::__1::__tuple_indices<0, 1, 2, 3>, const int &, const int &, const float &, const int &>::__tuple_impl<std::__1::tuple<int &&, int &&, float &&, int &&>, void>' requested here
            : base_(_VSTD::forward<_Tuple>(__t)) {}
              ^
/usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/upcxx-inst/upcxx.debug.gasnet_seq.smp/include/upcxx/future/future1.hpp:192:14: note: in instantiation of function template specialization 'std::__1::tuple<const int &, const int &, const float &, const int &>::tuple<std::__1::tuple<int &&, int &&, float &&, int &&>, false>' requested here
      return get_at_(
             ^
/usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/upcxx/test/future.cpp:171:8: note: in instantiation of function template specialization 'upcxx::future1<upcxx::detail::future_kind_when_all<upcxx::future1<upcxx::detail::future_kind_shref<upcxx::detail::future_header_ops_general>, int>, upcxx::future1<upcxx::detail::future_kind_shref<upcxx::detail::future_header_ops_general>, int>, upcxx::future1<upcxx::detail::future_kind_result, float>, upcxx::future1<upcxx::detail::future_kind_shref<upcxx::detail::future_header_ops_general>, int> >, int, int, float, int>::result_reference<-1>' requested here
  THEM(result_reference())
       ^
In file included from /usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/upcxx/test/future.cpp:2:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue:169:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque:158:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer:7:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:628:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:609:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:221:10: error: static_assert failed "Attempted to construct a reference element in a tuple with an rvalue"
        {static_assert(!is_reference<_Hp>::value ||
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:437:15: note: in instantiation of function template specialization 'std::__1::__tuple_leaf<1, const int &, false>::__tuple_leaf<int, void>' requested here
            : __tuple_leaf<_Indx, _Tp>(_VSTD::forward<typename tuple_element<_Indx,
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:662:15: note: in instantiation of function template specialization 'std::__1::__tuple_impl<std::__1::__tuple_indices<0, 1, 2, 3>, const int &, const int &, const float &, const int &>::__tuple_impl<std::__1::tuple<int &&, int &&, float &&, int &&>, void>' requested here
            : base_(_VSTD::forward<_Tuple>(__t)) {}
              ^
/usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/upcxx-inst/upcxx.debug.gasnet_seq.smp/include/upcxx/future/future1.hpp:192:14: note: in instantiation of function template specialization 'std::__1::tuple<const int &, const int &, const float &, const int &>::tuple<std::__1::tuple<int &&, int &&, float &&, int &&>, false>' requested here
      return get_at_(
             ^
/usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/upcxx/test/future.cpp:171:8: note: in instantiation of function template specialization 'upcxx::future1<upcxx::detail::future_kind_when_all<upcxx::future1<upcxx::detail::future_kind_shref<upcxx::detail::future_header_ops_general>, int>, upcxx::future1<upcxx::detail::future_kind_shref<upcxx::detail::future_header_ops_general>, int>, upcxx::future1<upcxx::detail::future_kind_result, float>, upcxx::future1<upcxx::detail::future_kind_shref<upcxx::detail::future_header_ops_general>, int> >, int, int, float, int>::result_reference<-1>' requested here
  THEM(result_reference())
       ^
In file included from /usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/upcxx/test/future.cpp:2:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue:169:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque:158:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer:7:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:628:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:609:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:221:10: error: static_assert failed "Attempted to construct a reference element in a tuple with an rvalue"
        {static_assert(!is_reference<_Hp>::value ||
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:437:15: note: in instantiation of function template specialization 'std::__1::__tuple_leaf<2, const float &, false>::__tuple_leaf<float, void>' requested here
            : __tuple_leaf<_Indx, _Tp>(_VSTD::forward<typename tuple_element<_Indx,
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:662:15: note: in instantiation of function template specialization 'std::__1::__tuple_impl<std::__1::__tuple_indices<0, 1, 2, 3>, const int &, const int &, const float &, const int &>::__tuple_impl<std::__1::tuple<int &&, int &&, float &&, int &&>, void>' requested here
            : base_(_VSTD::forward<_Tuple>(__t)) {}
              ^
/usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/upcxx-inst/upcxx.debug.gasnet_seq.smp/include/upcxx/future/future1.hpp:192:14: note: in instantiation of function template specialization 'std::__1::tuple<const int &, const int &, const float &, const int &>::tuple<std::__1::tuple<int &&, int &&, float &&, int &&>, false>' requested here
      return get_at_(
             ^
/usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/upcxx/test/future.cpp:171:8: note: in instantiation of function template specialization 'upcxx::future1<upcxx::detail::future_kind_when_all<upcxx::future1<upcxx::detail::future_kind_shref<upcxx::detail::future_header_ops_general>, int>, upcxx::future1<upcxx::detail::future_kind_shref<upcxx::detail::future_header_ops_general>, int>, upcxx::future1<upcxx::detail::future_kind_result, float>, upcxx::future1<upcxx::detail::future_kind_shref<upcxx::detail::future_header_ops_general>, int> >, int, int, float, int>::result_reference<-1>' requested here
  THEM(result_reference())
       ^
In file included from /usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/upcxx/test/future.cpp:2:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/queue:169:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/deque:158:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__split_buffer:7:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:628:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:609:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:221:10: error: static_assert failed "Attempted to construct a reference element in a tuple with an rvalue"
        {static_assert(!is_reference<_Hp>::value ||
         ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:437:15: note: in instantiation of function template specialization 'std::__1::__tuple_leaf<3, const int &, false>::__tuple_leaf<int, void>' requested here
            : __tuple_leaf<_Indx, _Tp>(_VSTD::forward<typename tuple_element<_Indx,
              ^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/tuple:662:15: note: in instantiation of function template specialization 'std::__1::__tuple_impl<std::__1::__tuple_indices<0, 1, 2, 3>, const int &, const int &, const float &, const int &>::__tuple_impl<std::__1::tuple<int &&, int &&, float &&, int &&>, void>' requested here
            : base_(_VSTD::forward<_Tuple>(__t)) {}
              ^
/usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/upcxx-inst/upcxx.debug.gasnet_seq.smp/include/upcxx/future/future1.hpp:192:14: note: in instantiation of function template specialization 'std::__1::tuple<const int &, const int &, const float &, const int &>::tuple<std::__1::tuple<int &&, int &&, float &&, int &&>, false>' requested here
      return get_at_(
             ^
/usr/local/upc/testers64/EX-el_capitan-smp-clang-pshm-pr181/runtime/work/dbg/upcxx/test/future.cpp:171:8: note: in instantiation of function template specialization 'upcxx::future1<upcxx::detail::future_kind_when_all<upcxx::future1<upcxx::detail::future_kind_shref<upcxx::detail::future_header_ops_general>, int>, upcxx::future1<upcxx::detail::future_kind_shref<upcxx::detail::future_header_ops_general>, int>, upcxx::future1<upcxx::detail::future_kind_result, float>, upcxx::future1<upcxx::detail::future_kind_shref<upcxx::detail::future_header_ops_general>, int> >, int, int, float, int>::result_reference<-1>' requested here
  THEM(result_reference())
       ^
4 errors generated.
make[1]: *** [wrap_test] Error 1
make: *** [future-seq] Error 2

Full logs:
https://upc-bugs.lbl.gov/upc_tests/test_logs/MISC/2020-02-28/upcxx-pr.EX-el_capitan-smp-clang-pshm-pr/23:30:59/harness/compile.rpt
https://upc-bugs.lbl.gov/upc_tests/test_logs/MISC/2020-02-28/upcxx-pr.EX-old_high_sierra-smp-clang-pshm-pr/23:34:51/harness/compile.rpt

Comments (2)

  1. Paul Hargrove reporter

    In pull request 181, Dan had provided the following:

    Here is the full declaration from <tuple> that is throwing the static assert:

        template <class _Tp,
                  class = typename enable_if<
                      __lazy_and<
                          __lazy_not<is_same<typename decay<_Tp>::type, __tuple_leaf>>
                        , is_constructible<_Hp, _Tp>
                        >::value
                    >::type
                >
            _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
            explicit __tuple_leaf(_Tp&& __t) _NOEXCEPT_((is_nothrow_constructible<_Hp, _Tp>::value))
                : value(_VSTD::forward<_Tp>(__t))
            {static_assert(!is_reference<_Hp>::value ||
                           (is_lvalue_reference<_Hp>::value &&
                            (is_lvalue_reference<_Tp>::value ||
                             is_same<typename remove_reference<_Tp>::type,
                                     reference_wrapper<
                                        typename remove_reference<_Hp>::type
                                     >
                                    >::value)) ||
                            (is_rvalue_reference<_Hp>::value &&
                             !is_lvalue_reference<_Tp>::value),
           "Attempted to construct a reference element in a tuple with an rvalue");}
    
  2. Log in to comment