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 deprecation warnings for message constants (backport #750) #751

Merged
merged 1 commit into from Jun 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions rosidl_generator_cpp/resource/msg__struct.hpp.em
Expand Up @@ -377,8 +377,11 @@ template<typename ContainerAllocator>
const @(MSG_TYPE_TO_CPP['wstring'])
@(message.structure.namespaced_type.name)_<ContainerAllocator>::@(c.name) = u"@(escape_wstring(c.value))";
@[ else ]@
#if __cplusplus < 201703L
// static constexpr member variable definitions are only needed in C++14 and below, deprecated in C++17
template<typename ContainerAllocator>
constexpr @(MSG_TYPE_TO_CPP[c.type.typename]) @(message.structure.namespaced_type.name)_<ContainerAllocator>::@(c.name);
#endif // __cplusplus < 201703L
@[ end if]@
@[ if c.name in msvc_common_macros]@
#if defined(_WIN32)
Expand Down
Expand Up @@ -100,11 +100,12 @@ if(rosidl_generate_interfaces_LIBRARY_NAME)
endif()
set_property(TARGET ${rosidl_generate_interfaces_TARGET}${_target_suffix}
PROPERTY DEFINE_SYMBOL "ROSIDL_TYPESUPPORT_INTROSPECTION_CPP_BUILDING_DLL")
set_property(TARGET ${rosidl_generate_interfaces_TARGET}${_target_suffix}
PROPERTY CXX_STANDARD 17)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set_target_properties(${rosidl_generate_interfaces_TARGET}${_target_suffix} PROPERTIES
CXX_STANDARD 17
COMPILE_OPTIONS -Wall -Wextra -Wpedantic
)
target_compile_options(${rosidl_generate_interfaces_TARGET}${_target_suffix}
PRIVATE -Wall -Wextra -Wpedantic)
endif()

target_include_directories(${rosidl_generate_interfaces_TARGET}${_target_suffix}
Expand Down