https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96592

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think this is a compiler bug. The same libstdc++ code compiles OK with clang.

The error doesn't really make any sense. std::is_constructible is certainly not
incomplete.

In file included from /home/jwakely/gcc/10/include/c++/10.2.1/bits/move.h:57,
                 from
/home/jwakely/gcc/10/include/c++/10.2.1/bits/stl_pair.h:59,
                 from /home/jwakely/gcc/10/include/c++/10.2.1/utility:70,
                 from /home/jwakely/gcc/10/include/c++/10.2.1/tuple:38,
                 from 96592-0.C:1:
/home/jwakely/gcc/10/include/c++/10.2.1/type_traits: In instantiation of
'struct std::__and_<std::is_constructible<SomeQuery<Session>, const
SomeQuery<Session>&>, std::__not_<std::__and_<std::is_convertible<const
SomeQuery<Session>&, SomeQuery<Session> > > > >':
/home/jwakely/gcc/10/include/c++/10.2.1/tuple:487:7:   required from 'static
constexpr bool std::_TupleConstraints<<anonymous>,
_Types>::__is_explicitly_constructible() [with _UTypes = {const
SomeQuery<Session>&}; bool <anonymous> = true; _Types = {SomeQuery<Session>}]'
/home/jwakely/gcc/10/include/c++/10.2.1/tuple:549:65:   required by
substitution of 'template<bool _NotEmpty, typename
std::enable_if<std::tuple<SomeQuery<Session>
>::_TCC<_Cond>::__is_explicitly_constructible<const SomeQuery<Session>&>(),
bool>::type <anonymous> > constexpr std::tuple<SomeQuery<Session>
>::tuple(const SomeQuery<Session>&) [with bool _NotEmpty = true; typename
std::enable_if<std::tuple<SomeQuery<Session>
>::_TCC<_Cond>::__is_explicitly_constructible<const SomeQuery<Session>&>(),
bool>::type <anonymous> = <missing>]'
/home/jwakely/gcc/10/include/c++/10.2.1/type_traits:901:30:   required from
'struct std::__is_constructible_impl<SomeQuery<Session>, const
SomeQuery<Session>&>'
/home/jwakely/gcc/10/include/c++/10.2.1/type_traits:906:12:   required from
'struct std::is_constructible<SomeQuery<Session>, const SomeQuery<Session>&>'
/home/jwakely/gcc/10/include/c++/10.2.1/type_traits:138:12:   required from
'struct std::__and_<std::is_constructible<SomeQuery<Session>, const
SomeQuery<Session>&>, std::is_convertible<const SomeQuery<Session>&,
SomeQuery<Session> > >'
/home/jwakely/gcc/10/include/c++/10.2.1/tuple:475:7:   required from 'static
constexpr bool std::_TupleConstraints<<anonymous>,
_Types>::__is_implicitly_constructible() [with _UTypes = {const
SomeQuery<Session>&}; bool <anonymous> = true; _Types = {SomeQuery<Session>}]'
/home/jwakely/gcc/10/include/c++/10.2.1/tuple:543:65:   required by
substitution of 'template<bool _NotEmpty, typename
std::enable_if<std::tuple<SomeQuery<Session>
>::_TCC<_Cond>::__is_implicitly_constructible<const SomeQuery<Session>&>(),
bool>::type <anonymous> > constexpr std::tuple<SomeQuery<Session>
>::tuple(const SomeQuery<Session>&) [with bool _NotEmpty = true; typename
std::enable_if<std::tuple<SomeQuery<Session>
>::_TCC<_Cond>::__is_implicitly_constructible<const SomeQuery<Session>&>(),
bool>::type <anonymous> = <missing>]'
96592-0.C:17:31:   required from here
/home/jwakely/gcc/10/include/c++/10.2.1/type_traits:138:12: error: incomplete
type 'std::is_constructible<SomeQuery<Session>, const SomeQuery<Session>&>'
used in nested name specifier
  138 |     struct __and_<_B1, _B2>
      |            ^~~~~~~~~~~~~~~~
In file included from 96592-0.C:1:
/home/jwakely/gcc/10/include/c++/10.2.1/tuple: In instantiation of 'static
constexpr bool std::_TupleConstraints<<anonymous>,
_Types>::__is_explicitly_constructible() [with _UTypes = {const
SomeQuery<Session>&}; bool <anonymous> = true; _Types = {SomeQuery<Session>}]':
/home/jwakely/gcc/10/include/c++/10.2.1/tuple:549:65:   required by
substitution of 'template<bool _NotEmpty, typename
std::enable_if<std::tuple<SomeQuery<Session>
>::_TCC<_Cond>::__is_explicitly_constructible<const SomeQuery<Session>&>(),
bool>::type <anonymous> > constexpr std::tuple<SomeQuery<Session>
>::tuple(const SomeQuery<Session>&) [with bool _NotEmpty = true; typename
std::enable_if<std::tuple<SomeQuery<Session>
>::_TCC<_Cond>::__is_explicitly_constructible<const SomeQuery<Session>&>(),
bool>::type <anonymous> = <missing>]'
/home/jwakely/gcc/10/include/c++/10.2.1/type_traits:901:30:   required from
'struct std::__is_constructible_impl<SomeQuery<Session>, const
SomeQuery<Session>&>'
/home/jwakely/gcc/10/include/c++/10.2.1/type_traits:906:12:   required from
'struct std::is_constructible<SomeQuery<Session>, const SomeQuery<Session>&>'
/home/jwakely/gcc/10/include/c++/10.2.1/type_traits:138:12:   required from
'struct std::__and_<std::is_constructible<SomeQuery<Session>, const
SomeQuery<Session>&>, std::is_convertible<const SomeQuery<Session>&,
SomeQuery<Session> > >'
/home/jwakely/gcc/10/include/c++/10.2.1/tuple:475:7:   required from 'static
constexpr bool std::_TupleConstraints<<anonymous>,
_Types>::__is_implicitly_constructible() [with _UTypes = {const
SomeQuery<Session>&}; bool <anonymous> = true; _Types = {SomeQuery<Session>}]'
/home/jwakely/gcc/10/include/c++/10.2.1/tuple:543:65:   required by
substitution of 'template<bool _NotEmpty, typename
std::enable_if<std::tuple<SomeQuery<Session>
>::_TCC<_Cond>::__is_implicitly_constructible<const SomeQuery<Session>&>(),
bool>::type <anonymous> > constexpr std::tuple<SomeQuery<Session>
>::tuple(const SomeQuery<Session>&) [with bool _NotEmpty = true; typename
std::enable_if<std::tuple<SomeQuery<Session>
>::_TCC<_Cond>::__is_implicitly_constructible<const SomeQuery<Session>&>(),
bool>::type <anonymous> = <missing>]'
96592-0.C:17:31:   required from here
/home/jwakely/gcc/10/include/c++/10.2.1/tuple:487:7: error: 'value' is not a
member of 'std::__and_<std::is_constructible<SomeQuery<Session>, const
SomeQuery<Session>&>, std::__not_<std::__and_<std::is_convertible<const
SomeQuery<Session>&, SomeQuery<Session> > > > >'
  487 |    >::value;
      |       ^~~~~




If I make this change it compiles with GCC (but with a -Wsystem-headers warning
about using a fold expression in C++11/14 code):

--- /home/jwakely/gcc/10/include/c++/10.2.1/tuple~      2020-09-03
16:05:45.063179301 +0100
+++ /home/jwakely/gcc/10/include/c++/10.2.1/tuple       2020-09-03
16:05:47.804179675 +0100
@@ -466,9 +466,8 @@
       template<typename... _UTypes>
        static constexpr bool __is_implicitly_constructible()
        {
-         return __and_<is_constructible<_Types, _UTypes>...,
-                       is_convertible<_UTypes, _Types>...
-                       >::value;
+         return (__is_constructible(_Types, _UTypes) && ...)
+            && __and_<is_convertible<_UTypes, _Types>...>::value;
        }

       // Constraint for a non-explicit constructor.


I see no reason why that change should "fix" anything.

Reply via email to