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

Move maybe::operator== back from maybe_common to maybe implementations #975

Merged
merged 5 commits into from
Jun 12, 2019

Conversation

volka
Copy link
Contributor

@volka volka commented May 20, 2019

The move of the maybe::operator== from the two variants to the common
base maybe_common causes an ambiguity with the allocator operator==
from libstdc++ in GCC 9.1. Moving them back to the variants fixes this
issue.

More detailed description:

When compiling Bond 8.1 code with gcc 9.1.0 / the current libstdc++, I get an ambiguous overload error for the

friend bool operator==(const maybe_common& lhs, const maybe_common& rhs)

from maybe.h line 195. The ambiguous other operator being

operator==(const allocator<_T1>&, const allocator<_T2>&)

from allocator.h:168 (and another similar one from new_allocator.h).

Moving the shared operator== implementation from maybe_common to both of the maybe variants fixes the issue, but I'm not sure if this is the best approach. See the attached patch. I'm also not sure what else would need to be updated.

The move of the maybe::operator== from the two variants to the common
base maybe_common causes an ambiguity with the allocator operator==
from libstdc++ in GCC 9.1. Moving them back to the variants fixes this
issue.

* Fix ambiguity in maybe::operator== with GCC 9.1
Copy link
Member

@chwarr chwarr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine to me. Can you add a note to the changelog in the unreleased C++ section?

@chwarr
Copy link
Member

chwarr commented Jun 5, 2019

I appear to have broken the CI builds (the images we use are no longer present). I've opened issue #979 about this. Until that's resolved, this cannot be merged. I don't expect @volka to fix this however, since it's an infrastructure problem unrelated to this change.

@chwarr chwarr merged commit 8bacbd3 into microsoft:master Jun 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants