[flang][cuda] Allow DO CONCURRENT in cuf kernel (#124190)
[llvm-project.git] / libcxx / test / std / utilities / utility / pairs / pairs.pair / ctor.default.pass.cpp
blob9c1adf5937cc0ccd4a8dbba387a76fdf3d370506
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 // <utility>
11 // template <class T1, class T2> struct pair
13 // explicit(see-below) constexpr pair();
15 // NOTE: The SFINAE on the default constructor is tested in
16 // default-sfinae.pass.cpp
18 #include <utility>
19 #include <type_traits>
20 #include <cassert>
22 #include "test_macros.h"
23 #include "archetypes.h"
25 int main(int, char**) {
27 typedef std::pair<float, short*> P;
28 P p;
29 assert(p.first == 0.0f);
30 assert(p.second == nullptr);
32 #if TEST_STD_VER >= 11
34 typedef std::pair<float, short*> P;
35 constexpr P p;
36 static_assert(p.first == 0.0f, "");
37 static_assert(p.second == nullptr, "");
40 using NoDefault = ImplicitTypes::NoDefault;
41 using P = std::pair<int, NoDefault>;
42 static_assert(!std::is_default_constructible<P>::value, "");
43 using P2 = std::pair<NoDefault, int>;
44 static_assert(!std::is_default_constructible<P2>::value, "");
47 struct Base {};
48 struct Derived : Base {
49 protected:
50 Derived() = default;
52 static_assert(!std::is_default_constructible<std::pair<Derived, int> >::value, "");
54 #endif
56 return 0;