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

Add most modifying sequence operations to libcpp.algorithm #3188

Merged
merged 16 commits into from Oct 21, 2019

Conversation

mje-nz
Copy link
Contributor

@mje-nz mje-nz commented Oct 16, 2019

Related: #2130

@scoder
Copy link
Contributor

scoder commented Oct 18, 2019

Thanks. This seems to trigger a compiler crash in the tests. Could you compile the cpp_stl_algo_modifying_sequence_ops test file yourself to see where it comes from? There's probably a stack trace that comes with it, but which I can't see in the travis logs.

@scoder scoder added this to the 3.0 milestone Oct 18, 2019
@mje-nz
Copy link
Contributor Author

mje-nz commented Oct 18, 2019

Sorry! I tidied preincrement(iter) to iter += 1 and mustn't have re-tested afterwards (and Travis doesn't email me on failures). Should be fixed now. Would you like an issue for the crash with a shorter example?

@mje-nz
Copy link
Contributor Author

mje-nz commented Oct 19, 2019

@scoder The test that still fails (libcpp_algo) isn't one I touched, and it fails in the same way on master and 0.29.13 on my machine. Any idea what's going on, or shall I just fix it?

=== C/C++ compiler error output: ===
In file included from libcpp_algo.cpp:627:
/Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:5135:5: error: no matching function for call to '__make_heap'
    __make_heap<_Comp_ref>(__first, __last, __comp);
    ^~~~~~~~~~~~~~~~~~~~~~
libcpp_algo.cpp:1316:10: note: in instantiation of function template specialization 'std::__1::make_heap<std::__1::__wrap_iter<int *>, bool (int, int)>' requested here
    std::make_heap<std::vector<int> ::iterator,bool (int, int)>(__pyx_v_v.begin(), __pyx_v_v.end(), __pyx_f_11libcpp_algo_greater);
         ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:5110:1: note: candidate function not viable: no known conversion from 'bool (*)(int, int)' to 'bool (&)(int, int)' for 3rd argument; dereference the argument with *
__make_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:5169:5: error: no matching function for call to '__sort_heap'
    __sort_heap<_Comp_ref>(__first, __last, __comp);
    ^~~~~~~~~~~~~~~~~~~~~~
libcpp_algo.cpp:1325:10: note: in instantiation of function template specialization 'std::__1::sort_heap<std::__1::__wrap_iter<int *>, bool (int, int)>' requested here
    std::sort_heap<std::vector<int> ::iterator,bool (int, int)>(__pyx_v_v.begin(), __pyx_v_v.end(), __pyx_f_11libcpp_algo_greater);
         ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:5151:1: note: candidate function not viable: no known conversion from 'bool (*)(int, int)' to 'bool (&)(int, int)' for 3rd argument; dereference the argument with *
__sort_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:5213:5: error: no matching function for call to '__partial_sort'
    __partial_sort<_Comp_ref>(__first, __middle, __last, __comp);
    ^~~~~~~~~~~~~~~~~~~~~~~~~
libcpp_algo.cpp:1520:10: note: in instantiation of function template specialization 'std::__1::partial_sort<std::__1::__wrap_iter<int *>, bool (int, int)>' requested here
    std::partial_sort<std::vector<int> ::iterator,bool (int, int)>(__pyx_v_v.begin(), (__pyx_v_v.begin() + __pyx_v_k), __pyx_v_v.end(), __pyx_f_11libcpp_algo_greater);
         ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:5185:1: note: candidate function not viable: no known conversion from 'bool (*)(int, int)' to 'bool (&)(int, int)' for 4th argument; dereference the argument with *
__partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last,
^
/Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:4201:5: error: no matching function for call to '__sort'
    __sort<_Comp_ref>(__first, __last, __comp);
    ^~~~~~~~~~~~~~~~~
libcpp_algo.cpp:1695:10: note: in instantiation of function template specialization 'std::__1::sort<std::__1::__wrap_iter<int *>, bool (int, int)>' requested here
    std::sort<std::vector<int> ::iterator,bool (int, int)>(__pyx_v_v.begin(), __pyx_v_v.end(), __pyx_f_11libcpp_algo_greater);
         ^
/Library/Developer/CommandLineTools/usr/include/c++/v1/algorithm:3998:1: note: candidate function not viable: no known conversion from 'bool (*)(int, int)' to 'bool (&)(int, int)' for 3rd argument; dereference the argument with *
__sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp)
^

@scoder
Copy link
Contributor

scoder commented Oct 20, 2019

I've seen the failure but couldn't figure out yet how to fix it. Any help appreciated.

@mje-nz
Copy link
Contributor Author

mje-nz commented Oct 20, 2019

It's #3180 again, I just don't understand how it was passing before. This commit fixes it on my machine.

@scoder
Copy link
Contributor

scoder commented Oct 20, 2019

Ah, yes, thanks. It totally looked like a bug to me. Let's see what travis and appveyor will say. (There's currently also an additional failing test on Windows, unrelated to this. I'll look into it soon.)

@scoder
Copy link
Contributor

scoder commented Oct 21, 2019

Thanks!

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

Successfully merging this pull request may close these issues.

None yet

2 participants