-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Compilation fails with Catch 1.7.0 #806
Comments
This is a duplicate of #798 and is caused by the THROWS family of macros now actually depending on received an expression, rather than pasting whatever it gets to a semicolon. |
This is bitter as it would mean to change a lot of tests... And how would I express something like CHECK_NOTHROW(my_json::json_value j(t); clean_up(j)); |
Is there a reason that it isn't equivalent with |
Well, this could maybe fix this issue, but in general it's convenient to have arbitrary code inside |
I adjusted my code to work with 1.7.0. |
If you can use C++11, then you still can run arbitrary code inside the REQUIRE_NOTHROW([&](){
int i = 1;
int j = 2;
auto k = i + j;
if (k == 3) {
throw 1;
}
return true;
}()); |
Thanks! Only one file was affected so rewriting was not so much work after all. Just out of curiosity: in the release notes for 1.7.0 you mention nlohmann/json - how did you cope with the compilation errors? |
I didn't actually, I benchmarked the tests after merging in the performance branch, but before merging in this change. |
Just as feedback: It would be great if you'd use Semantic Versioning to make it easier for users to assess whether an update would break existing code. |
@nlohmann In fact we do (try) to use Semantic Versioning. |
Description
JSON for Modern C++ currently uses Catch 1.6.0 for its test suite. Executing
make
yields only a few warnings which have nothing to do with Catch. So far, so good.When I update Catch to version 1.7.0, the compilation fails (output below).
(Related to nlohmann/json#445)
Steps to reproduce
test/thirdparty/catch/catch.hpp
with Catch 1.7.0make
In particular:
git clone https://github.com/nlohmann/json.git cd json rm test/thirdparty/catch/catch.hpp wget https://github.com/philsquared/Catch/releases/download/v1.7.0/catch.hpp -O test/thirdparty/catch/catch.hpp make
Extra information
Error output:
The text was updated successfully, but these errors were encountered: