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

std::sort_heap use (possible deleted) operator, #42408

Closed
llvmbot opened this issue Aug 20, 2019 · 7 comments
Closed

std::sort_heap use (possible deleted) operator, #42408

llvmbot opened this issue Aug 20, 2019 · 7 comments
Assignees
Labels
bugzilla libc++

Comments

@llvmbot
Copy link
Collaborator

@llvmbot llvmbot commented Aug 20, 2019

Bugzilla Link 43063
Resolution FIXED
Resolved on Aug 20, 2019 14:36
Version unspecified
OS Linux
Attachments test.cc
Reporter LLVM Bugzilla Contributor
CC @mclow

Extended Description

Summary: std::sort_heap use (possible deleted) operator, and failed to compile if it's deleted.

Steps to Reproduce: clang++ -o /dev/null -std=c++11 --compile test.cc
(test.cc attched)

Actual Results:
In file included from test.cc:1:
/home/yiyan/.local/bin/../include/c++/v1/algorithm:4998:67: error: overload resolution selected deleted operator ','
for (difference_type __n = __last - __first; __n > 1; --__last, --__n)
~~~~~~~~^ ~~~~~
/home/yiyan/.local/bin/../include/c++/v1/algorithm:5008:5: note: in instantiation of function template specialization 'std::__1::__sort_heap<std::__1::__less<int, int> &, random_access_iterator_wrapper >' requested here
__sort_heap<_Comp_ref>(__first, __last, __comp);
^
/home/yiyan/.local/bin/../include/c++/v1/algorithm:5016:12: note: in instantiation of function template specialization 'std::__1::sort_heap<random_access_iterator_wrapper, std::__1::__less<int, int> >' requested here
_VSTD::sort_heap(__first, __last, __less<typename iterator_traits<_RandomAccessIterator>::value_type>());
^
test.cc:33:10: note: in instantiation of function template specialization 'std::__1::sort_heap<random_access_iterator_wrapper >' requested here
std::sort_heap(sortcon.begin(), sortcon.end());
^
test.cc:23:10: note: candidate function [with U = long] has been explicitly deleted
void operator,(U) = delete;
^
1 error generated.

Expected Results: No error

Build Date & Hardware: Build 2019-08-20 on Linux x86_64

@llvmbot
Copy link
Collaborator Author

@llvmbot llvmbot commented Aug 20, 2019

assigned to @mclow

@mclow
Copy link
Contributor

@mclow mclow commented Aug 20, 2019

What version of clang/libc++ are you working off of?

Your test program compiles fine for me using trunk.

@mclow
Copy link
Contributor

@mclow mclow commented Aug 20, 2019

I think you attached the wrong file.

@mclow
Copy link
Contributor

@mclow mclow commented Aug 20, 2019

Never mind; I have reproduced it.

@llvmbot
Copy link
Collaborator Author

@llvmbot llvmbot commented Aug 20, 2019

test.cc

@llvmbot
Copy link
Collaborator Author

@llvmbot llvmbot commented Aug 20, 2019

You are right, and I've updated the attachment, in case if it's needed.

@mclow
Copy link
Contributor

@mclow mclow commented Aug 20, 2019

Fixed in revision 369448

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla libc++
Projects
None yet
Development

No branches or pull requests

2 participants