New dangling reference warning in develop
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- testing-qa
Research direction
Start with boost/test/impl/framework.ipp at lines 403 and 1000, then inspect runtime_config::get and nearby tests. Confirm the warning with GCC 13 on MinGW and verify that the dangling-reference warnings no longer appear without changing the intended filter or logger behavior.
Written by the indexing model from the issue text.
Description
After updating to develop I see:
gcc.compile.c++ ..\..\..\bin.v2\libs\test\build\gcc-13\debug\x86_64\cxxstd-17-gnu\link-static\pch-off\threadapi-win32\threading-multi\visibility-hidden\framework.o
In file included from D:/data/boost/boost/libs/test/src/framework.cpp:16:
..\..\../boost/test/impl/framework.ipp: In function 'bool boost::unit_test::framework::impl::parse_filters(boost::unit_test::test_unit_id, boost::unit_test::test_unit_id_list&, boost::unit_test::test_unit_id_list&)':
..\..\../boost/test/impl/framework.ipp:403:37: warning: possibly dangling reference to a temporary [-Wdangling-reference]
403 | std::vector<std::string> const& filters = runtime_config::get<std::vector<std::string> >( runtime_config::btrt_run_filters );
| ^~~~~~~ ..\..\../boost/test/impl/framework.ipp:403:93: note: the temporary was destroyed at the end of the full expression 'boost::unit_test::runtime_config::get<std::vector<std::__cxx11::basic_string<char> > >(boost::unit_test::basic_cstring<const char>(boost::unit_test::runtime_config::btrt_run_filters))'
403 | std::vector<std::string> const& filters = runtime_config::get<std::vector<std::string> >( runtime_config::btrt_run_filters );
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
..\..\../boost/test/impl/framework.ipp: In function 'void boost::unit_test::framework::impl::setup_loggers()':
..\..\../boost/test/impl/framework.ipp:1000:45: warning: possibly dangling reference to a temporary [-Wdangling-reference]
1000 | const std::vector<std::string>& v_output_format = runtime_config::get< std::vector<std::string> >( runtime_config::btrt_combined_logger ) ;
| ^~~~~~~~~~~~~~~
..\..\../boost/test/impl/framework.ipp:1000:110: note: the temporary was destroyed at the end of the full expression 'boost::unit_test::runtime_config::get<std::vector<std::__cxx11::basic_string<char> > >(boost::unit_test::basic_cstring<const char>(boost::unit_test::runtime_config::btrt_combined_logger))'
1000 | const std::vector<std::string>& v_output_format = runtime_config::get< std::vector<std::string> >( runtime_config::btrt_combined_logger ) ;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
With gcc-13 Mingw.
- Dominant language
- C++
- Stars
- 213
- Forks
- 149
- Avg merge
- 18h 17m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/test
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
Conversion Warning with GCC15 when using operator<< within custom failure message and -WConversion Open
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·