[Bug libstdc++/94203] New: experimental/executor and socket header issues-
erich.keane at intel dot com
gcc-bugzilla@gcc.gnu.org
Tue Mar 17 16:16:33 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94203
Bug ID: 94203
Summary: experimental/executor and socket header issues-
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: erich.keane at intel dot com
Target Milestone: ---
Again detected by trying to compile these headers with clang, I get two more
issues. They can be reproduced here: https://godbolt.org/z/L-UVGq though that
still shows the previous version's issue with service_already_exists.
First, it appears that _TgtImpl attempts to add 'const' to the return type of
the overridden function:
../include/c++/10.0.1/experimental/executor:1170:2: error:
return type of virtual function 'target' is not covariant with the return
type of the function it overrides (class type
'const void *' is more qualified than class type 'void *'
target(const std::type_info& __ti) const
^
../include/c++/10.0.1/experimental/executor:1138:21: note:
overridden virtual function is here
virtual void* target(const std::type_info&) const = 0;
The second issue is that socket_errc doesn't pass is_error_code_enum in
__basic_socket_impl:
../include/c++/10.0.1/experimental/socket:571:9: error:
no viable overloaded '='
__ec = socket_errc::already_open;
~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
../include/c++/10.0.1/system_error:208:7: note:
candidate template ignored: requirement
'is_error_code_enum<std::experimental::net::v1::socket_errc>::value' was not
satisfied [with _ErrorCodeEnum = std::experimental::net::v1::socket_errc]
operator=(_ErrorCodeEnum __e) noexcept
^
(it then goes on to show a bunch of other options).
However, I believe this is because Clang is instantiating this check right
away, but the explicit specialization for socket_errc is after it:
https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/experimental/socket#L2605
In fact, clang diagnoses this as well:
../include/c++/10.0.1/experimental/socket:2606:12: error:
explicit specialization of
'std::is_error_code_enum<std::experimental::net::v1::socket_errc>' after
instantiation
struct is_error_code_enum<experimental::net::v1::socket_errc>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../include/c++/10.0.1/system_error:206:26: note:
implicit instantiation first required here
typename enable_if<is_error_code_enum<_ErrorCodeEnum>::value,
^
More information about the Gcc-bugs
mailing list