Skip to content

Commit 01a1ca7

Browse files
committed
[libc++][NFC] Format a pait test
I'll be modifying this test in a future PR.
1 parent 2153672 commit 01a1ca7

File tree

1 file changed

+28
-27
lines changed

1 file changed

+28
-27
lines changed

libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.default.pass.cpp

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,42 @@
1515
// NOTE: The SFINAE on the default constructor is tested in
1616
// default-sfinae.pass.cpp
1717

18-
1918
#include <utility>
2019
#include <type_traits>
2120
#include <cassert>
2221

2322
#include "test_macros.h"
2423
#include "archetypes.h"
2524

26-
int main(int, char**)
27-
{
28-
{
29-
typedef std::pair<float, short*> P;
30-
P p;
31-
assert(p.first == 0.0f);
32-
assert(p.second == nullptr);
33-
}
25+
int main(int, char**) {
26+
{
27+
typedef std::pair<float, short*> P;
28+
P p;
29+
assert(p.first == 0.0f);
30+
assert(p.second == nullptr);
31+
}
3432
#if TEST_STD_VER >= 11
35-
{
36-
typedef std::pair<float, short*> P;
37-
constexpr P p;
38-
static_assert(p.first == 0.0f, "");
39-
static_assert(p.second == nullptr, "");
40-
}
41-
{
42-
using NoDefault = ImplicitTypes::NoDefault;
43-
using P = std::pair<int, NoDefault>;
44-
static_assert(!std::is_default_constructible<P>::value, "");
45-
using P2 = std::pair<NoDefault, int>;
46-
static_assert(!std::is_default_constructible<P2>::value, "");
47-
}
48-
{
49-
struct Base { };
50-
struct Derived : Base { protected: Derived() = default; };
51-
static_assert(!std::is_default_constructible<std::pair<Derived, int> >::value, "");
52-
}
33+
{
34+
typedef std::pair<float, short*> P;
35+
constexpr P p;
36+
static_assert(p.first == 0.0f, "");
37+
static_assert(p.second == nullptr, "");
38+
}
39+
{
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, "");
45+
}
46+
{
47+
struct Base {};
48+
struct Derived : Base {
49+
protected:
50+
Derived() = default;
51+
};
52+
static_assert(!std::is_default_constructible<std::pair<Derived, int> >::value, "");
53+
}
5354
#endif
5455

5556
return 0;

0 commit comments

Comments
 (0)