40 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// <queue>10 11// priority_queue();12 13// const_reference top() const;14 15#include <queue>16#include <cassert>17 18#include "test_macros.h"19 20TEST_CONSTEXPR_CXX26 bool test() {21 std::priority_queue<int> q;22 q.push(1);23 assert(q.top() == 1);24 q.push(3);25 assert(q.top() == 3);26 q.push(2);27 assert(q.top() == 3);28 29 return true;30}31 32int main(int, char**) {33 assert(test());34#if TEST_STD_VER >= 2635 static_assert(test());36#endif37 38 return 0;39}40