-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Matcher combination does not work outside macro call #2777
Comments
I assume you found the part of docs that says
since you have the matchers live in their own vars. Note that |
Yes, I had read that. After some more thought, I think I misinterpreted that note. auto is_close_to_but_not_zero = is_close_to_zero && ! is_zero;
auto is_not_zero = ! is_zero;
auto is_close_to_but_not_zero = is_close_to_zero && is_not_zero; it is still in scope. Am I interpreting it correctly? |
Yes.
|
Understood. Thanks and apologies for the noise. |
No problem. I'll probably add more examples to the docs to make this clearer. |
Describe the bug
Matchers (at least floating point matchers) cannot be combined outside of a macro call.
Expected behavior
To be able to combine matchers arbitrarily and use them in a macro.
Reproduction steps
Given the following two definitions
I can combine them in the macro like
CHECK_THAT(a_value, is_close_to_zero && ! is_zero);
but not outside of the macro like
The latter gives a segfault.
Platform information:
Additional context
None
The text was updated successfully, but these errors were encountered: