Bug 1764725 - Fix gtest uninitialized warnings with GCC. r=nika

Differential Revision: https://phabricator.services.mozilla.com/D144076
This commit is contained in:
Mike Hommey 2022-04-20 03:40:51 +00:00
Родитель 20fcb7c0fa
Коммит 082a0514b0
2 изменённых файлов: 30 добавлений и 3 удалений

Просмотреть файл

@ -299,17 +299,18 @@ class MatcherBase : private MatcherDescriberInterface {
}
protected:
MatcherBase() : vtable_(nullptr) {}
MatcherBase() : vtable_(nullptr), buffer_() {}
// Constructs a matcher from its implementation.
template <typename U>
explicit MatcherBase(const MatcherInterface<U>* impl) {
explicit MatcherBase(const MatcherInterface<U>* impl)
: vtable_(nullptr), buffer_() {
Init(impl);
}
template <typename M, typename = typename std::remove_reference<
M>::type::is_gtest_matcher>
MatcherBase(M&& m) { // NOLINT
MatcherBase(M&& m) : vtable_(nullptr), buffer_() { // NOLINT
Init(std::forward<M>(m));
}

26
third_party/googletest/issue3514.patch поставляемый Normal file
Просмотреть файл

@ -0,0 +1,26 @@
diff --git a/googletest/include/gtest/gtest-matchers.h b/googletest/include/gtest/gtest-matchers.h
index 75836605..3d3bea31 100644
--- a/googletest/include/gtest/gtest-matchers.h
+++ b/googletest/include/gtest/gtest-matchers.h
@@ -299,17 +299,18 @@ class MatcherBase : private MatcherDescriberInterface {
}
protected:
- MatcherBase() : vtable_(nullptr) {}
+ MatcherBase() : vtable_(nullptr), buffer_() {}
// Constructs a matcher from its implementation.
template <typename U>
- explicit MatcherBase(const MatcherInterface<U>* impl) {
+ explicit MatcherBase(const MatcherInterface<U>* impl)
+ : vtable_(nullptr), buffer_() {
Init(impl);
}
template <typename M, typename = typename std::remove_reference<
M>::type::is_gtest_matcher>
- MatcherBase(M&& m) { // NOLINT
+ MatcherBase(M&& m) : vtable_(nullptr), buffer_() { // NOLINT
Init(std::forward<M>(m));
}