boostorg / boostorg/test

New dangling reference warning in develop

Open
#447 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
213
Forks
149
Avg merge
18h 17m
Merged PRs (30d)
2

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 const& filters = runtime_config::get >( 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 > >(boost::unit_test::basic_cstring(boost::unit_test::runtime_config::btrt_run_filters))'
403 | std::vector const& filters = runtime_config::get >( 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& v_output_format = runtime_config::get< std::vector >( 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 > >(boost::unit_test::basic_cstring(boost::unit_test::runtime_config::btrt_combined_logger))'
1000 | const std::vector& v_output_format = runtime_config::get< std::vector >( runtime_config::btrt_combined_logger ) ;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
```

With gcc-13 Mingw.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.