public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/96592] [10/11 Regression] Tuple element w/ member reference to incomplete template type rejected
Date: Thu, 03 Sep 2020 15:18:49 +0000	[thread overview]
Message-ID: <bug-96592-4-aizogEulfn@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-96592-4@http.gcc.gnu.org/bugzilla/>

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.

  parent reply	other threads:[~2020-09-03 15:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12 16:15 [Bug c++/96592] New: " cuzdav at gmail dot com
2020-08-14  0:19 ` [Bug c++/96592] " johnilacqua at hotmail dot com
2020-08-17 21:51 ` [Bug libstdc++/96592] [10/11 Regression] " mpolacek at gcc dot gnu.org
2020-09-03 15:18 ` redi at gcc dot gnu.org [this message]
2020-09-03 15:37 ` cvs-commit at gcc dot gnu.org
2020-09-03 15:38 ` [Bug libstdc++/96592] [10 " redi at gcc dot gnu.org
2020-09-03 15:43 ` redi at gcc dot gnu.org
2020-12-17 15:12 ` ppalka at gcc dot gnu.org
2021-03-29 20:04 ` cvs-commit at gcc dot gnu.org
2021-03-30  4:18 ` ppalka at gcc dot gnu.org
2021-04-08 12:02 ` rguenth at gcc dot gnu.org
2021-11-26 17:41 ` redi at gcc dot gnu.org
2021-11-26 17:41 ` redi at gcc dot gnu.org
2021-11-26 23:07 ` cvs-commit at gcc dot gnu.org
2022-04-21 15:34 ` cvs-commit at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-96592-4-aizogEulfn@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).