diff --git a/libcxx/docs/Status/Cxx2bIssues.csv b/libcxx/docs/Status/Cxx2bIssues.csv --- a/libcxx/docs/Status/Cxx2bIssues.csv +++ b/libcxx/docs/Status/Cxx2bIssues.csv @@ -73,7 +73,7 @@ `3519 `__,"Incomplete synopses for classes","June 2021","","" `3520 `__,"``iter_move`` and ``iter_swap`` are inconsistent for ``transform_view::iterator``","June 2021","","" `3521 `__,"Overly strict requirements on ``qsort`` and ``bsearch``","June 2021","","" -`3522 `__,"Missing requirement on ``InputIterator`` template parameter for ``priority_queue`` constructors","June 2021","","" +`3522 `__,"Missing requirement on ``InputIterator`` template parameter for ``priority_queue`` constructors","June 2021","|Complete|","14.0" `3523 `__,"``iota_view::sentinel`` is not always ``iota_view``'s sentinel","June 2021","","" `3526 `__,"Return types of ``uses_allocator_construction_args`` unspecified","June 2021","","" `3527 `__,"``uses_allocator_construction_args`` handles rvalue pairs of rvalue references incorrectly","June 2021","","" diff --git a/libcxx/docs/Status/RangesIssues.csv b/libcxx/docs/Status/RangesIssues.csv --- a/libcxx/docs/Status/RangesIssues.csv +++ b/libcxx/docs/Status/RangesIssues.csv @@ -1,4 +1,4 @@ -"Number","Name","Status","Assignee" +"Number","Name","Status","First released version" `P0896R4 `__,,, `P1035R7 `__,Input Range Adaptors,, `P1207R4 `__,Movability Of Single-Pass Iterators,, @@ -67,7 +67,7 @@ `LWG3505 `__, split_view::outer-iterator::operator++ misspecified,, `LWG3517 `__,"join_view::iterator's iter_swap is underconstrained",, `LWG3520 `__,"iter_move and iter_swap are inconsistent for transform_view::iterator",, -`LWG3522 `__,"Missing requirement on InputIterator template parameter for priority_queue constructors",, +`LWG3522 `__,"Missing requirement on InputIterator template parameter for priority_queue constructors","Complete","14.0" `LWG3523 `__,"iota_view::sentinel is not always iota_view's sentinel",, `LWG3532 `__,"split_view::inner-iterator::operator++(int) should depend on Base",, `LWG3533 `__,"Make base() const & consistent across iterator wrappers that supports input_iterators",, diff --git a/libcxx/include/queue b/libcxx/include/queue --- a/libcxx/include/queue +++ b/libcxx/include/queue @@ -491,16 +491,16 @@ _LIBCPP_INLINE_VISIBILITY priority_queue(const value_compare& __comp, container_type&& __c); #endif - template + template ::value> > _LIBCPP_INLINE_VISIBILITY priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp = value_compare()); - template + template ::value> > _LIBCPP_INLINE_VISIBILITY priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp, const container_type& __c); #ifndef _LIBCPP_CXX03_LANG - template + template ::value> > _LIBCPP_INLINE_VISIBILITY priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp, container_type&& __c); @@ -666,7 +666,7 @@ #endif // _LIBCPP_CXX03_LANG template -template +template inline priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp) @@ -677,7 +677,7 @@ } template -template +template inline priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp, @@ -692,7 +692,7 @@ #ifndef _LIBCPP_CXX03_LANG template -template +template inline priority_queue<_Tp, _Container, _Compare>::priority_queue(_InputIter __f, _InputIter __l, const value_compare& __comp, diff --git a/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_constraint.compile.pass.cpp b/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_constraint.compile.pass.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_constraint.compile.pass.cpp @@ -0,0 +1,39 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++03 + +// + +// template +// priority_queue(InputIterator first, InputIterator last, const Compare& = Compare()); +// template +// priority_queue(InputIterator first, InputIterator last, const Compare&, const Container&); +// template +// priority_queue(InputIterator first, InputIterator last, const Compare&, Container&&); + +#include +#include +#include + +// Sanity-check that std::vector is constructible from two ints... +static_assert( std::is_constructible, int*, int*>::value, ""); +static_assert( std::is_constructible, int , int >::value, ""); + +// ...but std::priority_queue is not. +static_assert( std::is_constructible, int*, int*>::value, ""); +static_assert(!std::is_constructible, int , int >::value, ""); + +static_assert( std::is_constructible, int*, int*, std::less>::value, ""); +static_assert(!std::is_constructible, int , int , std::less>::value, ""); + +static_assert( std::is_constructible, int*, int*, std::less, std::vector>::value, ""); +static_assert(!std::is_constructible, int , int , std::less, std::vector>::value, ""); + +static_assert( std::is_constructible, int*, int*, std::less, std::vector&>::value, ""); +static_assert(!std::is_constructible, int , int , std::less, std::vector&>::value, "");