[Bug libstdc++/94033] New: is_trivially_copy_constructible<> fails with compiler error on complicated object with private default constructor
avi@cloudius-systems.com
gcc-bugzilla@gcc.gnu.org
Wed Mar 4 16:40:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94033
Bug ID: 94033
Summary: is_trivially_copy_constructible<> fails with compiler
error on complicated object with private default
constructor
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: avi@cloudius-systems.com
Target Milestone: ---
gcc 10 regression: the same source file builds in gcc 9. The preprocessed file
from gcc 10 fails on gcc 9 with the same error, so the bug is likely in
libstdc++.
Error trail:
g++ -MD -MT build/dev/database.o -MF build/dev/database.o.d
-I/home/avi/scylla/seastar/include
-I/home/avi/scylla/build/dev/seastar/gen/include -std=gnu++17 -U_FORTIFY_SOURCE
-Wno-maybe-uninitialized -Werror=unused-result -fstack-clash-protection
-fconcepts -DSEASTAR_API_LEVEL=2 -DSEASTAR_HAVE_GCC6_CONCEPTS
-DSEASTAR_USE_STD_OPTIONAL_VARIANT_STRINGVIEW -DSEASTAR_TYPE_ERASE_MORE
-DFMT_LOCALE -DFMT_SHARED -I/usr/include/p11-kit-1 -O1
-DSEASTAR_ENABLE_ALLOC_FAILURE_INJECTION -I. -I build/dev/gen -march=westmere
-DBOOST_TEST_DYN_LINK -fvisibility=hidden -Wall -Werror -Wno-mismatched-tags
-Wno-maybe-uninitialized -Wno-tautological-compare -Wno-missing-braces
-Wno-misleading-indentation -Wno-overflow -Wno-noexcept-type
-Wno-nonnull-compare -Wno-error=cpp -Wno-ignored-attributes
-Wno-overloaded-virtual -Wno-stringop-overflow
-Wno-error=deprecated-declarations -DXXH_PRIVATE_API -DSEASTAR_TESTING_MAIN
-DHAVE_LIBSYSTEMD=1 -DHAVE_LZ4_COMPRESS_DEFAULT -c -o build/dev/database.o
database.cc
In file included from /usr/include/c++/10/bits/move.h:57,
from /usr/include/c++/10/bits/stl_pair.h:59,
from /usr/include/c++/10/utility:70,
from
/home/avi/scylla/seastar/include/seastar/core/shared_ptr.hh:25,
from dht/i_partitioner.hh:43,
from database.hh:25,
from database.cc:22:
/usr/include/c++/10/type_traits: In instantiation of ‘struct
std::__is_nt_default_constructible_atom<mutation>’:
/usr/include/c++/10/type_traits:976:12: required from ‘struct
std::__is_nt_default_constructible_impl<mutation, false>’
/usr/include/c++/10/type_traits:138:12: required from ‘struct
std::__and_<std::__is_constructible_impl<mutation>,
std::__is_nt_default_constructible_impl<mutation, false> >’
/usr/include/c++/10/type_traits:987:12: required from ‘struct
std::is_nothrow_default_constructible<mutation>’
/usr/include/c++/10/type_traits:133:12: required from ‘struct
std::__and_<std::is_nothrow_default_constructible<mutation> >’
/usr/include/c++/10/tuple:623:2: required from ‘constexpr
std::tuple<_Elements>::tuple() [with _Dummy = void; typename
std::enable_if<std::_TupleConstraints<std::is_void<_Dummy>::value, _Elements
...>::__is_explicitly_default_constructible(), bool>::type <anonymous> = false;
_Elements = {mutation}]’
/usr/include/c++/10/type_traits:1183:30: required from ‘struct
std::is_trivially_constructible<std::tuple<mutation> >’
/home/avi/scylla/seastar/include/seastar/core/future.hh:210:51: required from
‘constexpr const bool seastar::internal::can_inherit<std::tuple<mutation> >’
/home/avi/scylla/seastar/include/seastar/core/future.hh:217:44: required from
‘struct seastar::internal::uninitialized_wrapper<std::tuple<mutation> >’
/home/avi/scylla/seastar/include/seastar/core/future.hh:395:8: required from
‘struct seastar::future_state<mutation>’
/home/avi/scylla/seastar/include/seastar/core/future.hh:962:24: required from
‘class seastar::future<mutation>’
database.cc:45:126: required from here
/usr/include/c++/10/type_traits:962:47: error: ‘constexpr mutation::mutation()’
is private within this context
962 | : public integral_constant<bool, noexcept(_Tp())>
| ^~~~~
In file included from database.hh:65,
from database.cc:22:
mutation.hh:49:5: note: declared private here
49 | mutation() = default;
| ^~~~~~~~
I have a reproducer, but it is 400k lines long after preprocessing. I'll spend
some time minimizing it and post it.
More information about the Gcc-bugs
mailing list