Example for "Defining a Custom Matcher Class" does not compile
Describe the bug
Trying out the example from https://github.com/google/googletest/blob/main/docs/gmock_cook_book.md#defining-a-custom-matcher-class-custommatcherclass results in error: could not convert ‘BarPlusBazEqMatcher(expected_sum)’ from ‘BarPlusBazEqMatcher’ to ‘testing::Matcher<const Foo&>’
Steps to reproduce the bug
Copy the example (BarPlusBazEqMatcher), add struct Foo { int bar() const; int baz() const; }; to the top of the file), try to compile it.
Does the bug persist in the most recent commit?
Yes
What operating system and version are you using?
Ubuntu 20.04
What compiler and version are you using?
gcc 9.4.0
What build system are you using?
Plain command line
Additional context
I took a look at the source and found that the solution seems to be to inherit from testing::MatcherInterface<T> instead?
same issue found when following the guide. OS version: Ubuntu 18.04 G++ version: 7.5.0
Can confirm, the example from the guide does not compile.