https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70101
--- Comment #1 from TC <rs2740 at gmail dot com> --- Test case for everything except the first: #include <queue> #include <functional> #include <vector> #include <memory> #include <utility> struct Cmp : std::less<int> { explicit Cmp(int) {}; }; Cmp comp(1); std::allocator<int> alloc; std::vector<int> vec; using PQ = std::priority_queue<int, std::vector<int>, Cmp>; PQ pq2(comp, alloc); PQ pq3(comp, vec, alloc); PQ pq4(comp, std::move(vec), alloc); PQ pq5(pq2, alloc); PQ pq6(std::move(pq2), alloc);