-
Notifications
You must be signed in to change notification settings - Fork 76
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
Equality operator returns false for an equal empty union #457
Comments
Interesting ... makes me wonder if it shouldn't simply end in |
Let me have a look at this |
reicheratwork
added a commit
to reicheratwork/cyclonedds-cxx
that referenced
this issue
Nov 6, 2023
This fixes the issue of comparison operators not returning true for unions with default cases not associated with a type for said default case Also added unittests for union comparison operators Signed-off-by: Martijn Reicher <[email protected]>
Also found some other issues that were exposed by creating a unittest that used unions with default cases, fixing those as well :) @jordanLatta155 , can I count on you to verify my fix and review my PR when I create it? |
reicheratwork
added a commit
to reicheratwork/cyclonedds-cxx
that referenced
this issue
Nov 7, 2023
This fixes the issue of comparison operators not returning true for unions with default cases not associated with a type for said default case Also added unittests for union comparison operators Signed-off-by: Martijn Reicher <[email protected]>
reicheratwork
added a commit
to reicheratwork/cyclonedds-cxx
that referenced
this issue
Nov 7, 2023
This fixes the issue of comparison operators not returning true for unions with default cases not associated with a type for said default case Also added unittests for union comparison operators Signed-off-by: Martijn Reicher <[email protected]>
eboasson
pushed a commit
that referenced
this issue
Nov 9, 2023
This fixes the issue of comparison operators not returning true for unions with default cases not associated with a type for said default case Also added unittests for union comparison operators Signed-off-by: Martijn Reicher <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have an IDL union with an enum discriminator with one of the enum cases being empty. The generated C++ code's == operator will return false when comparing two "empty" unions , even if their discriminator is the same.
example:
IDL:
C++:
The last
return false
in the generated C++ is the branched reached when both_d()
are equal toAllocationState::Free
.The text was updated successfully, but these errors were encountered: