public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ostash at ostash dot kiev.ua" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/100667] [11/12 Regression] std::tuple<A&&> cannot be constructed from A&&, if A not defined (only forward declared)
Date: Fri, 18 Jun 2021 07:56:06 +0000	[thread overview]
Message-ID: <bug-100667-4-9pzoTpabaP@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100667-4@http.gcc.gnu.org/bugzilla/>

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

Viktor Ostashevskyi <ostash at ostash dot kiev.ua> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ostash at ostash dot kiev.ua

--- Comment #1 from Viktor Ostashevskyi <ostash at ostash dot kiev.ua> ---
Hello,

I have another example, but probably related:


#include <tuple>
#include <string>

class Foo{};

std::tuple<std::string, Foo> bar()
{
    return { {}, Foo{}};
}


Fails starting from GCC 11.1 in C++11/14/17/20 modes with the following error:

<source>: In function 'std::tuple<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >, Foo> bar()':
<source>:8:23: error: conversion from '<brace-enclosed initializer list>' to
'std::tuple<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >, Foo>' is ambiguous
    8 |     return { {}, Foo{}};
      |                       ^
In file included from <source>:1:
/opt/compiler-explorer/gcc-11.1.0/include/c++/11.1.0/tuple:1144:9: note:
candidate: 'std::tuple<_T1, _T2>::tuple(std::allocator_arg_t, const _Alloc&)
[with _Alloc = Foo; typename
std::enable_if<std::_TupleConstraints<std::is_object<_Alloc>::value, _T1,
_T2>::__is_implicitly_default_constructible(), bool>::type <anonymous> = true;
_T1 = std::__cxx11::basic_string<char>; _T2 = Foo]'
 1144 |         tuple(allocator_arg_t __tag, const _Alloc& __a)
      |         ^~~~~
/opt/compiler-explorer/gcc-11.1.0/include/c++/11.1.0/tuple:1052:9: note:
candidate: 'constexpr std::tuple<_T1, _T2>::tuple(const _T1&, const _T2&) [with
bool _Dummy = true; typename std::enable_if<std::_TupleConstraints<_Dummy, _T1,
_T2>::__is_implicitly_constructible<const _T1&, const _T2&>(), bool>::type
<anonymous> = true; _T1 = std::__cxx11::basic_string<char>; _T2 = Foo]'
 1052 |         tuple(const _T1& __a1, const _T2& __a2)
      |

  parent reply	other threads:[~2021-06-18  7:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19  8:00 [Bug libstdc++/100667] New: " piotrwn1 at gmail dot com
2021-05-19  9:09 ` [Bug libstdc++/100667] [11/12 Regression] " redi at gcc dot gnu.org
2021-06-18  7:56 ` ostash at ostash dot kiev.ua [this message]
2021-07-28  7:07 ` rguenth at gcc dot gnu.org
2022-04-21  7:49 ` rguenth at gcc dot gnu.org
2023-05-29 10:05 ` [Bug libstdc++/100667] [11/12/13/14 " jakub at gcc dot gnu.org
2023-05-29 11:16 ` piotrwn1 at gmail dot com
2024-03-27 12:59 ` redi at gcc dot gnu.org
2024-03-27 13:36 ` redi at gcc dot gnu.org
2024-03-27 14:02 ` redi at gcc dot gnu.org
2024-03-27 14:03 ` redi at gcc dot gnu.org
2024-03-27 14:14 ` redi at gcc dot gnu.org
2024-03-27 17:44 ` redi at gcc dot gnu.org
2024-03-28 18:26 ` cvs-commit at gcc dot gnu.org
2024-03-28 22:33 ` [Bug libstdc++/100667] [11/12/13 " redi at gcc dot gnu.org
2024-05-01 20:31 ` 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-100667-4-9pzoTpabaP@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).