Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests don't build against libc++ #44

Closed
wak-google opened this issue Oct 22, 2019 · 1 comment
Closed

Tests don't build against libc++ #44

wak-google opened this issue Oct 22, 2019 · 1 comment

Comments

@wak-google
Copy link

Looks like libc++ doesn't like std::equal between volatile and non-volatile members in the test cases

In file included from /build/span-lite/test/span.t.cpp:11:
In file included from /build/span-lite/test/span-main.t.hpp:19:
In file included from /build/span-lite/include/nonstd/span.hpp:194:
/usr/include/c++/v1/algorithm:1325:14: error: no matching function for call to object of type 'std::__1::__equal_to<int, int>'
        if (!__pred(*__first1, *__first2))
             ^~~~~~
/usr/include/c++/v1/algorithm:1337:19: note: in instantiation of function template specialization 'std::__1::equal<const volatile int *, int *, std::__1::__equal_to<int, int> >' requested here
    return _VSTD::equal(__first1, __last1, __first2, __equal_to<__v1, __v2>());
                  ^
/build/span-lite/test/span.t.cpp:441:18: note: in instantiation of function template specialization 'std::__1::equal<const volatile int *, int *>' requested here
    EXPECT( std::equal( x.begin(), x.end(), arr ) );
                 ^
/build/span-lite/test/lest_cpp03.hpp:257:28: note: expanded from macro 'EXPECT'
# define EXPECT            lest_EXPECT
                           ^
/usr/include/c++/v1/algorithm:682:10: note: candidate function not viable: 1st argument ('const volatile int') would lose volatile qualifier
    bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
         ^
1 error generated.
make[2]: *** [test/CMakeFiles/span-lite-cpp98.t.dir/build.make:76: test/CMakeFiles/span-lite-cpp98.t.dir/span.t.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:134: test/CMakeFiles/span-lite-cpp98.t.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/build/span-lite/test/span.t.cpp:89:99: warning: 'operator()' is deprecated: replace operator() with operator[] [-Wdeprecated-declarations]
        static void blow_iv(index_type i) { int arr[] = { 1, 2, 3, }; span<int> v( arr ); (void) v(i); }
                                                                                                  ^
/build/span-lite/include/nonstd/span.hpp:1067:5: note: 'operator()' has been explicitly marked deprecated here
    span_deprecated("replace operator() with operator[]")
    ^
/build/span-lite/include/nonstd/span.hpp:388:33: note: expanded from macro 'span_deprecated'
# define span_deprecated(msg) [[deprecated(msg)]]
                                ^
/build/span-lite/test/span.t.cpp:596:18: warning: 'operator()' is deprecated: replace operator() with operator[] [-Wdeprecated-declarations]
        EXPECT( v(i) == arr[i] );
                 ^
/build/span-lite/test/lest_cpp03.hpp:257:28: note: expanded from macro 'EXPECT'
# define EXPECT            lest_EXPECT
                           ^
/build/span-lite/include/nonstd/span.hpp:1067:5: note: 'operator()' has been explicitly marked deprecated here
    span_deprecated("replace operator() with operator[]")
    ^
/build/span-lite/include/nonstd/span.hpp:388:33: note: expanded from macro 'span_deprecated'
# define span_deprecated(msg) [[deprecated(msg)]]
                                ^
/build/span-lite/test/span.t.cpp:597:18: warning: 'operator()' is deprecated: replace operator() with operator[] [-Wdeprecated-declarations]
        EXPECT( w(i) == arr[i] );
                 ^
/build/span-lite/test/lest_cpp03.hpp:257:28: note: expanded from macro 'EXPECT'
# define EXPECT            lest_EXPECT
                           ^
/build/span-lite/include/nonstd/span.hpp:1067:5: note: 'operator()' has been explicitly marked deprecated here
    span_deprecated("replace operator() with operator[]")
    ^
/build/span-lite/include/nonstd/span.hpp:388:33: note: expanded from macro 'span_deprecated'
# define span_deprecated(msg) [[deprecated(msg)]]
                                ^
/build/span-lite/test/span.t.cpp:681:6: warning: 'operator()' is deprecated: replace operator() with operator[] [-Wdeprecated-declarations]
    v(1) = 22;
     ^
/build/span-lite/include/nonstd/span.hpp:1067:5: note: 'operator()' has been explicitly marked deprecated here
    span_deprecated("replace operator() with operator[]")
    ^
/build/span-lite/include/nonstd/span.hpp:388:33: note: expanded from macro 'span_deprecated'
# define span_deprecated(msg) [[deprecated(msg)]]
                                ^
/build/span-lite/test/span.t.cpp:682:6: warning: 'operator()' is deprecated: replace operator() with operator[] [-Wdeprecated-declarations]
    w(2) = 33;
     ^
/build/span-lite/include/nonstd/span.hpp:1067:5: note: 'operator()' has been explicitly marked deprecated here
    span_deprecated("replace operator() with operator[]")
    ^
/build/span-lite/include/nonstd/span.hpp:388:33: note: expanded from macro 'span_deprecated'
# define span_deprecated(msg) [[deprecated(msg)]]
                                ^
In file included from /build/span-lite/test/span.t.cpp:11:
In file included from /build/span-lite/test/span-main.t.hpp:19:
In file included from /build/span-lite/include/nonstd/span.hpp:194:
/usr/include/c++/v1/algorithm:1325:14: error: no matching function for call to object of type 'std::__1::__equal_to<int, int>'
        if (!__pred(*__first1, *__first2))
             ^~~~~~
/usr/include/c++/v1/algorithm:1337:19: note: in instantiation of function template specialization 'std::__1::equal<const volatile int *, int *, std::__1::__equal_to<int, int> >' requested here
    return _VSTD::equal(__first1, __last1, __first2, __equal_to<__v1, __v2>());
                  ^
/build/span-lite/test/span.t.cpp:441:18: note: in instantiation of function template specialization 'std::__1::equal<const volatile int *, int *>' requested here
    EXPECT( std::equal( x.begin(), x.end(), arr ) );
                 ^
/build/span-lite/test/lest_cpp03.hpp:257:28: note: expanded from macro 'EXPECT'
# define EXPECT            lest_EXPECT
                           ^
/usr/include/c++/v1/algorithm:682:10: note: candidate function not viable: 1st argument ('const volatile int') would lose volatile qualifier
    bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
         ^
1 error generated.
make[2]: *** [test/CMakeFiles/span-lite-cpp11.t.dir/build.make:76: test/CMakeFiles/span-lite-cpp11.t.dir/span.t.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:208: test/CMakeFiles/span-lite-cpp11.t.dir/all] Error 2
In file included from /build/span-lite/test/span.t.cpp:11:
In file included from /build/span-lite/test/span-main.t.hpp:19:
In file included from /build/span-lite/include/nonstd/span.hpp:194:
/usr/include/c++/v1/algorithm:1325:14: error: no matching function for call to object of type 'std::__1::__equal_to<int, int>'
        if (!__pred(*__first1, *__first2))
             ^~~~~~
/usr/include/c++/v1/algorithm:1337:19: note: in instantiation of function template specialization 'std::__1::equal<const volatile int *, int *, std::__1::__equal_to<int, int> >' requested here
    return _VSTD::equal(__first1, __last1, __first2, __equal_to<__v1, __v2>());
                  ^
/build/span-lite/test/span.t.cpp:441:18: note: in instantiation of function template specialization 'std::__1::equal<const volatile int *, int *>' requested here
    EXPECT( std::equal( x.begin(), x.end(), arr ) );
                 ^
/build/span-lite/test/lest_cpp03.hpp:257:28: note: expanded from macro 'EXPECT'
# define EXPECT            lest_EXPECT
                           ^
/usr/include/c++/v1/algorithm:682:10: note: candidate function not viable: 1st argument ('const volatile int') would lose volatile qualifier
    bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
         ^
1 error generated.
make[2]: *** [test/CMakeFiles/span-lite-cpp14.t.dir/build.make:76: test/CMakeFiles/span-lite-cpp14.t.dir/span.t.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:97: test/CMakeFiles/span-lite-cpp14.t.dir/all] Error 2
In file included from /build/span-lite/test/span.t.cpp:11:
In file included from /build/span-lite/test/span-main.t.hpp:19:
In file included from /build/span-lite/include/nonstd/span.hpp:194:
/usr/include/c++/v1/algorithm:1325:14: error: no matching function for call to object of type 'std::__1::__equal_to<int, int>'
        if (!__pred(*__first1, *__first2))
             ^~~~~~
/usr/include/c++/v1/algorithm:1337:19: note: in instantiation of function template specialization 'std::__1::equal<const volatile int *, int *, std::__1::__equal_to<int, int> >' requested here
    return _VSTD::equal(__first1, __last1, __first2, __equal_to<__v1, __v2>());
                  ^
/build/span-lite/test/span.t.cpp:441:18: note: in instantiation of function template specialization 'std::__1::equal<const volatile int *, int *>' requested here
    EXPECT( std::equal( x.begin(), x.end(), arr ) );
                 ^
/build/span-lite/test/lest_cpp03.hpp:257:28: note: expanded from macro 'EXPECT'
# define EXPECT            lest_EXPECT
                           ^
/usr/include/c++/v1/algorithm:682:10: note: candidate function not viable: 1st argument ('const volatile int') would lose volatile qualifier
    bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
         ^
5 warnings and 1 error generated.
make[2]: *** [test/CMakeFiles/span-lite-cpp17.t.dir/build.make:76: test/CMakeFiles/span-lite-cpp17.t.dir/span.t.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:171: test/CMakeFiles/span-lite-cpp17.t.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
wkennington added a commit to wkennington/span-lite that referenced this issue Dec 13, 2019
wkennington added a commit to wkennington/span-lite that referenced this issue Dec 13, 2019
libc++ doesn't allow us to perform std::equal on volatile and
non-volatile types. We can work around this by iterating over the span
and manually comparing.
wkennington added a commit to wkennington/span-lite that referenced this issue Dec 13, 2019
libc++ doesn't allow us to perform std::equal on volatile and
non-volatile types. We can work around this by iterating over the span
and manually comparing.
wkennington added a commit to wkennington/span-lite that referenced this issue Dec 13, 2019
libc++ doesn't allow us to perform std::equal on volatile and
non-volatile types. We can work around this by iterating over the span
and manually comparing.
martinmoene pushed a commit that referenced this issue Dec 15, 2019
libc++ doesn't allow us to perform std::equal on volatile and
non-volatile types. We can work around this by iterating over the span
and manually comparing.
@martinmoene
Copy link
Owner

Solved by #52 , thanks to @wak-google / @wkennington

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants