Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / libcxx / test / std / utilities / utility / pairs / pairs.pair / dtor.pass.cpp
blobf19bce86f270b6575b7a7bad2107041540859f31
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-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03
11 // <utility>
13 // template <class T1, class T2> struct pair
15 // ~pair()
17 // C++17 added:
18 // The destructor of pair shall be a trivial destructor
19 // if (is_trivially_destructible_v<T1> && is_trivially_destructible_v<T2>) is true.
22 #include <utility>
23 #include <type_traits>
24 #include <string>
25 #include <cassert>
27 #include "test_macros.h"
29 int main(int, char**)
31 static_assert((std::is_trivially_destructible<
32 std::pair<int, float> >::value), "");
33 static_assert((!std::is_trivially_destructible<
34 std::pair<int, std::string> >::value), "");
36 return 0;