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

Troubleshoot "dangling pointer" warning in iterator_interface.t.cpp #15

Open
camio opened this issue Nov 7, 2024 · 0 comments
Open

Comments

@camio
Copy link
Collaborator

camio commented Nov 7, 2024

This warning shows up in the CI job. It was originally pointed out by #13 (review)

/home/runner/work/iterator_interface/iterator_interface/src/beman/iterator_interface26/iterator_interface.t.cpp:5:
/home/runner/work/iterator_interface/iterator_interface/src/beman/iterator_interface26/iterator_interface.t.cpp: In member function ‘virtual void beman::iterator_interface26::IteratorTest_OperatorArrow_Test::TestBody()’:
/home/runner/work/iterator_interface/iterator_interface/src/beman/iterator_interface26/iterator_interface.t.cpp:117:20: warning: using a dangling pointer to an unnamed temporary [-Wdangling-pointer=]
  117 |     ASSERT_EQ(ai->f(), 3);
      |               ~~~~~^~
In file included from /home/runner/work/iterator_interface/iterator_interface/include/beman/iterator_interface26/iterator_interface.hpp:8,
                 from /home/runner/work/iterator_interface/iterator_interface/src/beman/iterator_interface26/iterator_interface.t.cpp:2:
/home/runner/work/iterator_interface/iterator_interface/include/beman/iterator_interface26/detail/stl_interfaces/iterator_interface.hpp:559:59: note: unnamed temporary defined here
  559 |           return detail::make_pointer<pointer, reference>(*derived());
      |                                                           ^~~~~~~~~~
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

No branches or pull requests

1 participant