Skip to content

Commit a7ac68a

Browse files
committed
formatting
1 parent 5de485c commit a7ac68a

File tree

1 file changed

+21
-21
lines changed
  • libcxx/test/std/utilities/variant/variant.variant/variant.ctor

1 file changed

+21
-21
lines changed

libcxx/test/std/utilities/variant/variant.variant/variant.ctor/T.pass.cpp

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,17 @@ struct NoThrowT {
3636
NoThrowT(int) noexcept(true) {}
3737
};
3838

39-
struct AnyConstructible { template <typename T> AnyConstructible(T&&) {} };
40-
struct NoConstructible { NoConstructible() = delete; };
39+
struct AnyConstructible {
40+
template <typename T>
41+
AnyConstructible(T&&) {}
42+
};
43+
struct NoConstructible {
44+
NoConstructible() = delete;
45+
};
4146
template <class T>
42-
struct RValueConvertibleFrom { RValueConvertibleFrom(T&&) {} };
47+
struct RValueConvertibleFrom {
48+
RValueConvertibleFrom(T&&) {}
49+
};
4350

4451
void test_T_ctor_noexcept() {
4552
{
@@ -59,21 +66,19 @@ void test_T_ctor_sfinae() {
5966
}
6067
{
6168
using V = std::variant<std::string, std::string>;
62-
static_assert(!std::is_constructible<V, const char *>::value, "ambiguous");
69+
static_assert(!std::is_constructible<V, const char*>::value, "ambiguous");
6370
}
6471
{
65-
using V = std::variant<std::string, void *>;
66-
static_assert(!std::is_constructible<V, int>::value,
67-
"no matching constructor");
72+
using V = std::variant<std::string, void*>;
73+
static_assert(!std::is_constructible<V, int>::value, "no matching constructor");
6874
}
6975
{
7076
using V = std::variant<std::string, float>;
7177
static_assert(!std::is_constructible<V, int>::value, "no matching constructor");
7278
}
7379
{
7480
using V = std::variant<std::unique_ptr<int>, bool>;
75-
static_assert(!std::is_constructible<V, std::unique_ptr<char>>::value,
76-
"no explicit bool in constructor");
81+
static_assert(!std::is_constructible<V, std::unique_ptr<char>>::value, "no explicit bool in constructor");
7782
struct X {
7883
operator void*();
7984
};
@@ -86,20 +91,13 @@ void test_T_ctor_sfinae() {
8691
operator X();
8792
};
8893
using V = std::variant<X>;
89-
static_assert(std::is_constructible<V, Y>::value,
90-
"regression on user-defined conversions in constructor");
94+
static_assert(std::is_constructible<V, Y>::value, "regression on user-defined conversions in constructor");
9195
}
9296
{
9397
using V = std::variant<AnyConstructible, NoConstructible>;
94-
static_assert(
95-
!std::is_constructible<V, std::in_place_type_t<NoConstructible>>::value,
96-
"no matching constructor");
97-
static_assert(!std::is_constructible<V, std::in_place_index_t<1>>::value,
98-
"no matching constructor");
98+
static_assert(!std::is_constructible<V, std::in_place_type_t<NoConstructible>>::value, "no matching constructor");
99+
static_assert(!std::is_constructible<V, std::in_place_index_t<1>>::value, "no matching constructor");
99100
}
100-
101-
102-
103101
}
104102

105103
void test_T_ctor_basic() {
@@ -137,15 +135,17 @@ void test_T_ctor_basic() {
137135
std::variant<RValueConvertibleFrom<int>> v1 = 42;
138136
assert(v1.index() == 0);
139137

140-
int x = 42;
138+
int x = 42;
141139
std::variant<RValueConvertibleFrom<int>, AnyConstructible> v2 = x;
142140
assert(v2.index() == 1);
143141
}
144142
}
145143

146144
struct BoomOnAnything {
147145
template <class T>
148-
constexpr BoomOnAnything(T) { static_assert(!std::is_same<T, T>::value, ""); }
146+
constexpr BoomOnAnything(T) {
147+
static_assert(!std::is_same<T, T>::value, "");
148+
}
149149
};
150150

151151
void test_no_narrowing_check_for_class_types() {

0 commit comments

Comments
 (0)