Skip to content

Commit f96a639

Browse files
deps: update googletest to 8b53336594cc52213c6c2c7a0b29194fa896d039
PR-URL: #64181 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent e09891c commit f96a639

4 files changed

Lines changed: 29 additions & 33 deletions

File tree

deps/googletest/include/gtest/gtest-assertion-result.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ class GTEST_API_ [[nodiscard]] AssertionResult {
161161
template <typename T>
162162
explicit AssertionResult(
163163
const T& success,
164-
typename std::enable_if<
165-
!std::is_convertible<T, AssertionResult>::value>::type*
164+
std::enable_if_t<!std::is_convertible_v<T, AssertionResult>>*
166165
/*enabler*/
167166
= nullptr)
168167
: success_(success) {}

deps/googletest/include/gtest/gtest-matchers.h

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ class [[nodiscard]] MatcherBase : private MatcherDescriberInterface {
277277
Init(impl);
278278
}
279279

280-
template <typename M, typename = typename std::remove_reference<
281-
M>::type::is_gtest_matcher>
280+
template <typename M,
281+
typename = typename std::remove_reference_t<M>::is_gtest_matcher>
282282
MatcherBase(M&& m) : vtable_(nullptr), buffer_() { // NOLINT
283283
Init(std::forward<M>(m));
284284
}
@@ -363,11 +363,10 @@ class [[nodiscard]] MatcherBase : private MatcherDescriberInterface {
363363
// from the impl, but some users really want to get their impl back when
364364
// they call GetDescriber().
365365
// We use std::get on a tuple as a workaround of not having `if constexpr`.
366-
return std::get<(
367-
std::is_convertible<decltype(&P::Get(m)),
368-
const MatcherDescriberInterface*>::value
369-
? 1
370-
: 0)>(std::make_tuple(&m, &P::Get(m)));
366+
return std::get<(std::is_convertible_v<decltype(&P::Get(m)),
367+
const MatcherDescriberInterface*>
368+
? 1
369+
: 0)>(std::make_tuple(&m, &P::Get(m)));
371370
}
372371

373372
template <typename P>
@@ -396,8 +395,8 @@ class [[nodiscard]] MatcherBase : private MatcherDescriberInterface {
396395
template <typename M>
397396
static constexpr bool IsInlined() {
398397
return sizeof(M) <= sizeof(Buffer) && alignof(M) <= alignof(Buffer) &&
399-
std::is_trivially_copy_constructible<M>::value &&
400-
std::is_trivially_destructible<M>::value;
398+
std::is_trivially_copy_constructible_v<M> &&
399+
std::is_trivially_destructible_v<M>;
401400
}
402401

403402
template <typename M, bool = MatcherBase::IsInlined<M>()>
@@ -444,7 +443,7 @@ class [[nodiscard]] MatcherBase : private MatcherDescriberInterface {
444443

445444
template <typename M>
446445
void Init(M&& m) {
447-
using MM = typename std::decay<M>::type;
446+
using MM = std::decay_t<M>;
448447
using Policy = ValuePolicy<MM>;
449448
vtable_ = GetVTable<Policy>();
450449
Policy::Init(*this, std::forward<M>(m));
@@ -473,14 +472,12 @@ class [[nodiscard]] Matcher : public internal::MatcherBase<T> {
473472
: internal::MatcherBase<T>(impl) {}
474473

475474
template <typename U>
476-
explicit Matcher(
477-
const MatcherInterface<U>* impl,
478-
typename std::enable_if<!std::is_same<U, const U&>::value>::type* =
479-
nullptr)
475+
explicit Matcher(const MatcherInterface<U>* impl,
476+
std::enable_if_t<!std::is_same_v<U, const U&>>* = nullptr)
480477
: internal::MatcherBase<T>(impl) {}
481478

482-
template <typename M, typename = typename std::remove_reference<
483-
M>::type::is_gtest_matcher>
479+
template <typename M,
480+
typename = typename std::remove_reference_t<M>::is_gtest_matcher>
484481
Matcher(M&& m) : internal::MatcherBase<T>(std::forward<M>(m)) {} // NOLINT
485482

486483
// Implicit constructor here allows people to write
@@ -509,8 +506,8 @@ Matcher<const std::string&> : public internal::MatcherBase<const std::string&> {
509506
explicit Matcher(const MatcherInterface<const std::string&>* impl)
510507
: internal::MatcherBase<const std::string&>(impl) {}
511508

512-
template <typename M, typename = typename std::remove_reference<
513-
M>::type::is_gtest_matcher>
509+
template <typename M,
510+
typename = typename std::remove_reference_t<M>::is_gtest_matcher>
514511
Matcher(M&& m) // NOLINT
515512
: internal::MatcherBase<const std::string&>(std::forward<M>(m)) {}
516513

@@ -533,8 +530,8 @@ Matcher<std::string> : public internal::MatcherBase<std::string> {
533530
explicit Matcher(const MatcherInterface<std::string>* impl)
534531
: internal::MatcherBase<std::string>(impl) {}
535532

536-
template <typename M, typename = typename std::remove_reference<
537-
M>::type::is_gtest_matcher>
533+
template <typename M,
534+
typename = typename std::remove_reference_t<M>::is_gtest_matcher>
538535
Matcher(M&& m) // NOLINT
539536
: internal::MatcherBase<std::string>(std::forward<M>(m)) {}
540537

@@ -559,8 +556,8 @@ class GTEST_API_ [[nodiscard]] Matcher<const internal::StringView&>
559556
explicit Matcher(const MatcherInterface<const internal::StringView&>* impl)
560557
: internal::MatcherBase<const internal::StringView&>(impl) {}
561558

562-
template <typename M, typename = typename std::remove_reference<
563-
M>::type::is_gtest_matcher>
559+
template <typename M,
560+
typename = typename std::remove_reference_t<M>::is_gtest_matcher>
564561
Matcher(M&& m) // NOLINT
565562
: internal::MatcherBase<const internal::StringView&>(std::forward<M>(m)) {
566563
}
@@ -587,8 +584,8 @@ class GTEST_API_ [[nodiscard]] Matcher<internal::StringView>
587584
explicit Matcher(const MatcherInterface<internal::StringView>* impl)
588585
: internal::MatcherBase<internal::StringView>(impl) {}
589586

590-
template <typename M, typename = typename std::remove_reference<
591-
M>::type::is_gtest_matcher>
587+
template <typename M,
588+
typename = typename std::remove_reference_t<M>::is_gtest_matcher>
592589
Matcher(M&& m) // NOLINT
593590
: internal::MatcherBase<internal::StringView>(std::forward<M>(m)) {}
594591

@@ -815,8 +812,8 @@ class [[nodiscard]] ImplicitCastEqMatcher {
815812
StoredRhs stored_rhs_;
816813
};
817814

818-
template <typename T, typename = typename std::enable_if<
819-
std::is_constructible<std::string, T>::value>::type>
815+
template <typename T,
816+
typename = std::enable_if_t<std::is_constructible_v<std::string, T>>>
820817
using StringLike = T;
821818

822819
// Implements polymorphic matchers MatchesRegex(regex) and

deps/googletest/include/gtest/gtest-printers.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -863,8 +863,8 @@ void PrintTupleTo(const T& t, std::integral_constant<size_t, I>,
863863
GTEST_INTENTIONAL_CONST_COND_POP_()
864864
*os << ", ";
865865
}
866-
UniversalPrinter<typename std::tuple_element<I - 1, T>::type>::Print(
867-
std::get<I - 1>(t), os);
866+
UniversalPrinter<std::tuple_element_t<I - 1, T>>::Print(std::get<I - 1>(t),
867+
os);
868868
}
869869

870870
template <typename... Types>
@@ -1218,7 +1218,7 @@ template <typename Tuple>
12181218
Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
12191219
Strings result;
12201220
TersePrintPrefixToStrings(
1221-
value, std::integral_constant<size_t, std::tuple_size<Tuple>::value>(),
1221+
value, std::integral_constant<size_t, std::tuple_size_v<Tuple>>(),
12221222
&result);
12231223
return result;
12241224
}

deps/googletest/include/gtest/gtest.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,7 +2164,7 @@ class GTEST_API_ [[nodiscard]] ScopedTrace {
21642164
// to cause a compiler error.
21652165
template <typename T1, typename T2>
21662166
constexpr bool StaticAssertTypeEq() noexcept {
2167-
static_assert(std::is_same<T1, T2>::value, "T1 and T2 are not the same type");
2167+
static_assert(std::is_same_v<T1, T2>, "T1 and T2 are not the same type");
21682168
return true;
21692169
}
21702170

@@ -2310,7 +2310,7 @@ template <int&... ExplicitParameterBarrier, typename Factory>
23102310
TestInfo* RegisterTest(const char* test_suite_name, const char* test_name,
23112311
const char* type_param, const char* value_param,
23122312
const char* file, int line, Factory factory) {
2313-
using TestT = typename std::remove_pointer<decltype(factory())>::type;
2313+
using TestT = std::remove_pointer_t<decltype(factory())>;
23142314

23152315
class FactoryImpl : public internal::TestFactoryBase {
23162316
public:

0 commit comments

Comments
 (0)