google / googletest

GoogleTest - Google Testing and Mocking Framework
https://google.github.io/googletest/
BSD 3-Clause "New" or "Revised" License
33.79k stars 10k forks source link

fix: explicitly copy-convert to StringType in StartsWith/EndsWith matchers #4391

Closed muggenhor closed 8 months ago

muggenhor commented 9 months ago

Instead of relying on automatic conversions, which won't happen if they're explicit! This fails with boost::string_view (GCC) and std::string_view (GCC and Clang both) for example.

google-cla[bot] commented 9 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

muggenhor commented 9 months ago

This change is not significant enough for me to believe it's even copyrightable. And I don't have the time to spend reading legal documents.

So do as you will with this change. E.g. go for your "own" fix when trying to use these matchers with a function taking boost::string_view/std::string_view parameter types on GCC.