Skip to content

Commit

Permalink
Initialize MatcherBase.buffer_ in the default constructor
Browse files Browse the repository at this point in the history
This fixes -Wuninitialized warnings with GCC.

Fixes google#3514.
  • Loading branch information
glandium committed Apr 20, 2022
1 parent 8ccdb9d commit 2aaf680
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion googletest/include/gtest/gtest-matchers.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class MatcherBase : private MatcherDescriberInterface {
}

protected:
MatcherBase() : vtable_(nullptr) {}
MatcherBase() : vtable_(nullptr), buffer_() {}

// Constructs a matcher from its implementation.
template <typename U>
Expand Down

0 comments on commit 2aaf680

Please sign in to comment.