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

EnumIterator inherits from std::iterator base class which is deprecated in c++17 #505

Closed
scpeters opened this issue Apr 17, 2023 · 5 comments · Fixed by #540
Closed

EnumIterator inherits from std::iterator base class which is deprecated in c++17 #505

scpeters opened this issue Apr 17, 2023 · 5 comments · Fixed by #540
Labels
bug Something isn't working 🎵 harmonic Gazebo Harmonic

Comments

@scpeters
Copy link
Member

Environment

  • OS Version: macOS 12.6.5 (Monterey) with macOS 13.1 SDK
  • Source or binary build? source build of gz-common5 as of 6f5ee94 (other versions too)

excerpt of brew config:

Clang: 14.0.0 build 1400
macOS: 12.6.5-x86_64
CLT: 14.2.0.0.1.1668646533
Xcode: N/A

Description

Screen Shot 2023-04-17 at 4 27 15 PM

src/EnumIface_TEST.cc:20:
/include/gz/common/EnumIface.hh:145:12: warning: 'iterator<std::bidirectional_iterator_tag, MyType>' is deprecated [-Wdeprecated-declarations]
    : std::iterator<std::bidirectional_iterator_tag, Enum>
           ^
src/EnumIface_TEST.cc:61:32: note: in instantiation of template class 'gz::common::EnumIterator<MyType>' requested here
  common::EnumIterator<MyType> end = MY_TYPE_END;
                               ^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/__iterator/iterator.h:27:29: note: 'iterator<std::bidirectional_iterator_tag, MyType>' has been explicitly marked deprecated here
struct _LIBCPP_TEMPLATE_VIS _LIBCPP_DEPRECATED_IN_CXX17 iterator
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/__config:1066:39: note: expanded from macro '_LIBCPP_DEPRECATED_IN_CXX17'
#  define _LIBCPP_DEPRECATED_IN_CXX17 _LIBCPP_DEPRECATED
                                      ^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/__config:1043:48: note: expanded from macro '_LIBCPP_DEPRECATED'
#    define _LIBCPP_DEPRECATED __attribute__ ((deprecated))
                                               ^

Steps to reproduce

  1. Build from source on macOS Monterey

or

  1. Run https://build.osrfoundation.org/view/ign-garden/job/ignition_common-ci-gz-common5-homebrew-amd64 on one of the macOS-monterey nodes

Output

Build Status https://build.osrfoundation.org/view/ign-garden/job/ignition_common-ci-gz-common5-homebrew-amd64/37/clang/

@scpeters scpeters added the bug Something isn't working label Apr 17, 2023
@scpeters
Copy link
Member Author

@mjcarroll is there a way to fix this on released versions without breaking API? If not, I think we should suppress the warning and fix it on main

@azeey azeey self-assigned this May 1, 2023
@azeey azeey added the 🎵 harmonic Gazebo Harmonic label May 1, 2023
@azeey
Copy link
Contributor

azeey commented May 1, 2023

I've added the harmonic label to make sure we include this in Harmonic.

@azeey azeey removed their assignment May 1, 2023
@mjcarroll
Copy link
Contributor

I think we should suppress the warning and fix it on main

We concluded this is the right answer after talking about it at the meeting yesterday.

@scpeters
Copy link
Member Author

scpeters commented Jul 29, 2023

@mjcarroll did you have any ideas for how to fix this on main? It's not urgent for Harmonic

mjcarroll added a commit that referenced this issue Aug 14, 2023
@scpeters
Copy link
Member Author

fixed in #529

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 🎵 harmonic Gazebo Harmonic
Projects
Archived in project
3 participants