33 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// <stack>10 11// void swap(stack& c)12// noexcept(__is_nothrow_swappable<container_type>::value);13 14// This tests a conforming extension15 16// UNSUPPORTED: c++0317 18#include <stack>19#include <utility>20#include <cassert>21 22#include "test_macros.h"23#include "MoveOnly.h"24 25int main(int, char**) {26 {27 typedef std::stack<MoveOnly> C;28 static_assert(noexcept(swap(std::declval<C&>(), std::declval<C&>())), "");29 }30 31 return 0;32}33