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

Detecting boost_test_print_type does not work when testing a type with an explicit conversion to bool #158

Closed
marc-groundctl opened this Issue Sep 11, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@marc-groundctl

marc-groundctl commented Sep 11, 2018

struct s {
	explicit operator bool() const { return false; }
};
std::ostream &boost_test_print_type(std::ostream &o, const s &) { return o << 's'; }

When testing a value of type s (e.g. BOOST_TEST(s{})), compilation fails because the compiler is looking for an overload of operator<<, but we haven't provided one. As per the documentation, providing a definition of boost_test_print_type should be sufficient.

raffienficiaud added a commit that referenced this issue Sep 23, 2018

Merge branch 'topic/GH-158-boost_test_print_type-printing-on-single-v…
…alue' into next-internal

* topic/GH-158-boost_test_print_type-printing-on-single-value:
  Change log
  Unary expression: fixing the printing issue

raffienficiaud added a commit that referenced this issue Sep 25, 2018

Merge branch 'topic/GH-158-boost_test_print_type-printing-on-single-v…
…alue' into next-internal

* topic/GH-158-boost_test_print_type-printing-on-single-value:
  Change log
  Unary expression: fixing the printing issue
@raffienficiaud

This comment has been minimized.

Member

raffienficiaud commented Sep 25, 2018

See #159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment