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 logging macros to build with msvc and cpp20 #2063

Merged
merged 1 commit into from
Dec 13, 2022

Conversation

msz-rai
Copy link
Contributor

@msz-rai msz-rai commented Dec 12, 2022

When I was building my project (CMAKE_CXX_STANDARD 20) with rclcpp on Windows, it failed with the same error as described in #1973 (c++17 + permissive flag added to MSVC). The same flag is set implicitly with C++20 because is required for C++20 Modules support.

I was trying to investigate why the template in logging macro is not passing standards conformance, but I was not able to find it out. It seems to be an MSVC issue. A similar problem was reported in Microsoft Developer Community more than a year ago and has not been resolved yet.

I used helper type aliases from type_traits instead of member types. This change makes rclcpp build successfully with MSVC and C++20.

Signed-off-by: Mateusz Szczygielski <mateusz.szczygielski@robotec.ai>
Copy link
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

Though the change shouldn't be needed, it's okay to do it.
LGTM!

@ivanpauno
Copy link
Member

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

@ivanpauno ivanpauno merged commit 86335dd into ros2:rolling Dec 13, 2022
@fujitatomoya
Copy link
Collaborator

@Mergifyio backport humble

Copy link

mergify bot commented May 14, 2024

backport humble

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request May 14, 2024
Signed-off-by: Mateusz Szczygielski <mateusz.szczygielski@robotec.ai>

Signed-off-by: Mateusz Szczygielski <mateusz.szczygielski@robotec.ai>
(cherry picked from commit 86335dd)
fujitatomoya pushed a commit that referenced this pull request May 14, 2024
Signed-off-by: Mateusz Szczygielski <mateusz.szczygielski@robotec.ai>

Signed-off-by: Mateusz Szczygielski <mateusz.szczygielski@robotec.ai>
(cherry picked from commit 86335dd)

Co-authored-by: Mateusz Szczygielski <112629916+msz-rai@users.noreply.github.com>
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.

None yet

3 participants