-
-
Notifications
You must be signed in to change notification settings - Fork 655
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
REQUIRE does not compile when operator== in different namespace #443
Comments
Well, this isn't good... Catch2 handles this OK as well - only doctest doesn't. I'm curious what's the use case of having the |
Am not sure. I came across this code when porting a large project from cppunit to doctest, I don't think it was put in that other namespace deliberately, more likely an accident. But it never caused any problem, well, except as we port to doctest. Fyi, the reason we prefer doctest over catch, is doctest support for threading, ie, calling REQUIRE from any thread. |
#468) * REQUIRE does not compile when operator== in different namespace #443 . Expression_lhs.op member method is not instantiated when it is missing a member operator and the user defined conversion is able to apply the global operator. * Removing utility and using an overloaded version of declval which is faster in doctest_fwd.h . * Using templated operator== inside TEST_CASE changes deduced types of forwarding references #399 . This is fixed by using rvalues as function argument and using forward for the right type of reference. Now both gcc and doctest either fails or either compiles but not like one compiles and the other fails
closed thanks to #468 (merged in |
#468) * REQUIRE does not compile when operator== in different namespace #443 . Expression_lhs.op member method is not instantiated when it is missing a member operator and the user defined conversion is able to apply the global operator. * Removing utility and using an overloaded version of declval which is faster in doctest_fwd.h . * Using templated operator== inside TEST_CASE changes deduced types of forwarding references #399 . This is fixed by using rvalues as function argument and using forward for the right type of reference. Now both gcc and doctest either fails or either compiles but not like one compiles and the other fails
Hi,
I have a simple equality that compiles normally but fails when placed within a
REQUIRE
. This is a surprise to me, since I was hoping to replace many of my manual tests (which are based onf ( a == b)
) by moving them into a REQUIRE. (Aside, this same conditional compiles when inside the equivalent CppUnit macro).To reproduce, please compile the file below. I used gcc 7.5.0 on Ubuntu 18, doctest 2.4.1
Error:
The declaration of the
operator==
outside theuser
namespace is significant; if I move it intouser
, everything does compiles.The text was updated successfully, but these errors were encountered: