Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch2 standalone header is incompatible with with Catch 3.7.1 #343

Closed
fun4jimmy opened this issue Sep 27, 2024 · 1 comment
Closed

Catch2 standalone header is incompatible with with Catch 3.7.1 #343

fun4jimmy opened this issue Sep 27, 2024 · 1 comment
Labels

Comments

@fun4jimmy
Copy link

I am trying to use FakeIt with Catch2 using vcpkg. When using the most recent version of vcpkg (as of 27/09/2024 with "builtin-baseline": "0affe8710a4a5b26328e909fe1ad7146df39d108") I get version 2.4.0 of FakeIt and version 3.7.1 of Catch.

When compiling a FakeIt::Mock with Visual Studio 2022 17.11.4 I get the following compiler errors:

1>C:\xxx\build\Visual Studio 17 2022\vcpkg_installed\x64-windows\include\fakeit\single_header\catch\fakeit.hpp(1210,39): error C2664: 'void Catch::AssertionHandler::handleMessage(Catch::ResultWas::OfType,std::string &&)': cannot convert argument 2 from 'std::string' to 'std::string &&'
1>(compiling source file 'xxx.cpp')
1>    C:\xxx\build\Visual Studio 17 2022\vcpkg_installed\x64-windows\include\fakeit\single_header\catch\fakeit.hpp(1210,64):
1>    You cannot bind an lvalue to an rvalue reference
1>    C:\xxx\build\Visual Studio 17 2022\vcpkg_installed\x64-windows\include\catch2\internal\catch_assertion_handler.hpp(50,14):
1>    see declaration of 'Catch::AssertionHandler::handleMessage'
1>    C:\xxx\build\Visual Studio 17 2022\vcpkg_installed\x64-windows\include\fakeit\single_header\catch\fakeit.hpp(1210,39):
1>    while trying to match the argument list '(Catch::ResultWas::OfType, std::string)'
1>C:\xxx\build\Visual Studio 17 2022\vcpkg_installed\x64-windows\include\fakeit\single_header\catch\fakeit.hpp(1213,17): error C3861: 'INTERNAL_CATCH_REACT': identifier not found
1>(compiling source file xxx.cpp')
1>C:\xxx\build\Visual Studio 17 2022\vcpkg_installed\x64-windows\include\fakeit\single_header\catch\fakeit.hpp(1214,13): error C2143: syntax error: missing ';' before '}'
1>(compiling source file 'xxx.cpp')

If I roll back the Catch version to 3.7.0 using an override in the vcpkg.json manifest the file compiles successfully.

Catch 3.7.1 removed the INTERNAL_CATCH_REACT define (catchorg/Catch2@b2b7cbd) and changed the signature of AssertionHandler::handleMessage (catchorg/Catch2@412cad5).

This was referenced Sep 28, 2024
@FranckRJ FranckRJ added the bug label Oct 6, 2024
@FranckRJ
Copy link
Collaborator

FranckRJ commented Oct 6, 2024

Fixed by #345 in FakeIt 2.4.1.

@FranckRJ FranckRJ closed this as completed Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants