| 1 | // { dg-do compile { target c++11 } } |
| 2 | |
| 3 | #include <queue> |
| 4 | |
| 5 | // LWG 3522 |
| 6 | // Missing requirement on InputIterator template parameter for priority_queue |
| 7 | // constructors |
| 8 | std::priority_queue<int> x = {1, 2}; // { dg-error "could not convert" } |
| 9 | |
| 10 | using Q = std::priority_queue<int>; |
| 11 | using Compare = Q::value_compare; |
| 12 | using Sequence = Q::container_type; |
| 13 | |
| 14 | static_assert( ! std::is_constructible<Q, int, int>(), |
| 15 | "priority_queue(InputIterator, InputIterator) is constrained" ); |
| 16 | |
| 17 | static_assert( ! std::is_constructible<Q, int, int, Compare>(), |
| 18 | "priority_queue(InputIterator, InputIterator, const Compare&) " |
| 19 | " is constrained" ); |
| 20 | |
| 21 | static_assert( ! std::is_constructible<Q, int, int, Compare, const Sequence&>(), |
| 22 | "and with const Sequence lvalue argument" ); |
| 23 | static_assert( ! std::is_constructible<Q, int, int, Compare, Sequence>(), |
| 24 | "and with Sequence rvalue argument" ); |