google / googletest

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

[Bug]: FloatingEqMatcher doesn't work with const float value types #4462

Open nickbrekhus opened 5 months ago

nickbrekhus commented 5 months ago

Describe the issue

FloatingEqMatcher doesn't work with const float value types. See https://godbolt.org/z/zexhra9eG. A const conversion is missing

Steps to reproduce the problem

https://godbolt.org/z/zexhra9eG

What version of GoogleTest are you using?

trunk

What operating system and version are you using?

(see godbolt repro)

What compiler and version are you using?

clang 15

What build system are you using?

(see godbolt repro)

Additional context

No response

nickbrekhus commented 3 months ago

@dinord Could you take a look? The issue/fix is pretty simple and avoids a pretty hard to understand diagnostic.