Bug 1832639

Summary: Test library doesn't build with -std=c++20 (a fix is available upstream)
Product: [Fedora] Fedora Reporter: Rafael Ávila de Espíndola <rafael>
Component: boostAssignee: Jonathan Wakely <jwakely>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 32CC: avi.kivity, dakingun, denis.arnaud_fedora, jwakely
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
URL: https://github.com/boostorg/test/commit/8ac88c62dcc809d42daf8b6bef10f7adecc46dd1
Whiteboard:
Fixed In Version: boost-1.69.0-16.fc32 boost-1.69.0-17.fc32 boost-1.69.0-12.fc31 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-14 02:36:13 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Rafael Ávila de Espíndola 2020-05-07 01:02:08 UTC
Boost-test in fedora 32 is missing 8ac88c62dcc809d42daf8b6bef10f7adecc46dd1, which is required to build with gcc 10 and -std=c++20.

The testcase is just a .cc file with

#include <boost/test/included/unit_test.hpp>

The error is:

% g++   -std=c++20  -c test.cc
In file included from /usr/include/boost/test/included/unit_test.hpp:29,
                 from test.cc:3:
/usr/include/boost/test/impl/test_tools.ipp: In member function ‘void boost::test_tools::tt_detail::print_log_value<const wchar_t*>::operator()(std::ostream&, const wchar_t*)’:
/usr/include/boost/test/impl/test_tools.ipp:119:38: error: use of deleted function ‘std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const wchar_t*) [with _Traits = std::char_traits<char>]’
  119 |     ostr << ( t ? t : L"null string" );
      |                                      ^
In file included from /usr/include/c++/10/iostream:39,
                 from /usr/include/boost/test/unit_test_log_formatter.hpp:26,
                 from /usr/include/boost/test/output/compiler_log_formatter.hpp:17,
                 from /usr/include/boost/test/impl/compiler_log_formatter.ipp:19,
                 from /usr/include/boost/test/included/unit_test.hpp:18,
                 from test.cc:3:
/usr/include/c++/10/ostream:634:5: note: declared here
  634 |     operator<<(basic_ostream<char, _Traits>&, const wchar_t*) = delete;
      |     ^~~~~~~~

Comment 1 Jonathan Wakely 2020-05-07 21:15:39 UTC
What is that code even supposed to do?

The old and new versions of the code both write a void* to the stream, which is surely not what is intended?

Why replace a null wchar_t* with the meaningless address of a string literal? Why not write null?

Comment 2 Jonathan Wakely 2020-05-07 21:24:38 UTC
And why does it use reinterpret_cast now?

Why isn't it just this:

  ostr << static_cast<const void*>(t);

?

I don't consider the upstream change a "fix" for that code.

Comment 3 Rafael Ávila de Espíndola 2020-05-08 00:23:34 UTC
Good point. Sorry, I only bisected the failure and didn't pay too much attention at what the change in boost was.

Comment 4 Jonathan Wakely 2020-05-08 10:58:32 UTC
I will patch it for Fedora, but I think I'll do it differently.

Comment 5 Avi Kivity 2020-05-11 11:43:38 UTC
Sorry to nag, but can we have even the upstream hack before the full fix? This is blocking our migration to C++20, which we are very anxious to perform.

I can promise lots of bug reports in return.

Comment 6 Jonathan Wakely 2020-05-11 11:58:59 UTC
It'll be in rawhide and updates-testing today.

Comment 7 Jonathan Wakely 2020-05-11 12:00:07 UTC
(In reply to Avi Kivity from comment #5)
> I can promise lots of bug reports in return.

I would expect nothing less from you guys ;-)

You're very reliable for finding issues on the bleeding edge.

Comment 8 Avi Kivity 2020-05-11 12:13:59 UTC
Many thanks. C++17 already looks like an old, unusable language.

Comment 9 Fedora Update System 2020-05-11 14:27:45 UTC
FEDORA-2020-9a959e761f has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-9a959e761f

Comment 10 Jonathan Wakely 2020-05-11 14:31:16 UTC
https://bodhi.fedoraproject.org/updates/FEDORA-2020-0e722ab915 is the F32 update (I'm not sure why bodhi didn't add a comment about it here).

Comment 11 Fedora Update System 2020-05-12 06:44:01 UTC
FEDORA-2020-9a959e761f has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-9a959e761f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-9a959e761f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2020-05-12 07:18:56 UTC
FEDORA-2020-0e722ab915 has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-0e722ab915`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-0e722ab915

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 13 Fedora Update System 2020-05-12 15:51:44 UTC
FEDORA-2020-9a959e761f has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-9a959e761f

Comment 14 Fedora Update System 2020-05-13 03:55:50 UTC
FEDORA-2020-920dd1ca57 has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-920dd1ca57`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-920dd1ca57

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 15 Fedora Update System 2020-05-13 05:51:36 UTC
FEDORA-2020-9a959e761f has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-9a959e761f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-9a959e761f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 16 Fedora Update System 2020-05-14 02:36:13 UTC
FEDORA-2020-920dd1ca57 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 17 Fedora Update System 2020-05-28 01:59:24 UTC
FEDORA-2020-9a959e761f has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.