Skip to content

Fix logging macros to build with msvc and cpp20 (backport #2063)#2529

Merged
fujitatomoya merged 1 commit intohumblefrom
mergify/bp/humble/pr-2063
May 14, 2024
Merged

Fix logging macros to build with msvc and cpp20 (backport #2063)#2529
fujitatomoya merged 1 commit intohumblefrom
mergify/bp/humble/pr-2063

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented May 14, 2024

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.


This is an automatic backport of pull request #2063 done by Mergify.

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

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

CI:

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

CC: @clalancette

Copy link
Copy Markdown
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.

Looks reasonable to me; since it changes a static_assert, there should be no API/ABI considerations here.

@fujitatomoya
Copy link
Copy Markdown
Collaborator

windows failure is unrelated, https://ci.ros2.org/job/ci_windows/21794/.

@fujitatomoya fujitatomoya merged commit ecf4ac4 into humble May 14, 2024
@delete-merged-branch delete-merged-branch bot deleted the mergify/bp/humble/pr-2063 branch May 14, 2024 14:46
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.

4 participants