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

Fix mpark/variant conditional for MSVC #77

Merged
merged 1 commit into from
Apr 6, 2023

Conversation

cottsay
Copy link
Member

@cottsay cottsay commented Apr 6, 2023

This conditional currently evaluates to TRUE when _MSC_VER is not defined, meaning that __SHOULD_USE_MPARK_VARIANT is 1 for ALL SYSTEMS except newer MSVC, which is certainly not correct.

From what I can tell, this bug has been present since 1.0.0. It only came to my attention when I started to see linking errors between libraries which use STL variant and ones which link against this package. I'm absolutely floored that this hasn't become a problem sooner.

This conditional currently evaluates to TRUE when _MSC_VER is not
defined, meaning that __SHOULD_USE_MPARK_VARIANT is 1 for ALL SYSTEMS
except newer MSVC, which is certainly not correct.

Fixes 06e1dbe
@cottsay cottsay added the bug Something isn't working label Apr 6, 2023
@cottsay cottsay requested a review from gbiggs as a code owner April 6, 2023 02:44
@cottsay cottsay self-assigned this Apr 6, 2023
Copy link
Contributor

@clalancette clalancette left a comment

Choose a reason for hiding this comment

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

Oh wow, this is a really good catch. This is actually the problem with ament/googletest#21 , and solves it in my testing. This looks good to me with green CI.

@cottsay
Copy link
Member Author

cottsay commented Apr 6, 2023

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Windows Build Status

@cottsay cottsay merged commit 3189b94 into rolling Apr 6, 2023
@cottsay cottsay deleted the cottsay/variant-conditional branch April 6, 2023 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants