From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AE5783861030; Mon, 17 Aug 2020 14:29:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE5783861030 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1597674543; bh=mrC+ArC+m6G/rYrWIFNkTNOEF0c+nv1r1NbWjJymM/w=; h=From:To:Subject:Date:In-Reply-To:References:From; b=vZxbrjvjYx8JRl7HbxeTQZJGicajrCT30DFQfZ4mnkP8KqlTkJuhdYgS8j/BEQZg8 uUgn+4HbutS9jSLChCwSPYlfly5/ITowjF333Qk0yE1JSEBO+GWupcd8f4JoGSnCdC tXL23GNfdd3BoHkhz4auNR2eqJHTFJ/H0Zz/y9Co= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/55713] std::tuple incorrectly is convertible to "ElementType" when it is an empty class Date: Mon, 17 Aug 2020 14:29:03 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 4.7.3 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Aug 2020 14:29:03 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D55713 --- Comment #7 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:91e6226f880b048275a7ceedef716e159c7cefd9 commit r11-2720-g91e6226f880b048275a7ceedef716e159c7cefd9 Author: Jonathan Wakely Date: Fri Aug 7 17:13:56 2020 +0100 libstdc++: Remove inheritance from elements in std::tuple This fixes a number of std::tuple bugs by no longer making use of the empty base-class optimization. By using the C++20 [[no_unique_address]] attribute we can always store the element as a data member, while still compressing the layout of tuples containing empty types. Since we no longer use inheritance we could also apply the compression optimization for final types and for tuples of tuples, but doing so would be an ABI break. Using [[no_unique_address]] more liberally for the unstable std::__8 configuration is left for a later date. There may be reasons not to apply the attribute unconditionally, e.g. see the discussion about guaranteed elision in PR 94062. libstdc++-v3/ChangeLog: PR libstdc++/55713 PR libstdc++/71096 PR libstdc++/93147 * include/std/tuple [__has_cpp_attribute(no_unique_address)] (_Head_base): New definition of the partial specialization, using [[no_unique_address]] instead of inheritance. * testsuite/libstdc++-prettyprinters/48362.cc: Adjust expected output. * testsuite/20_util/tuple/comparison_operators/93147.cc: New te= st. * testsuite/20_util/tuple/creation_functions/55713.cc: New test. * testsuite/20_util/tuple/element_access/71096.cc: New test.=