From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8863F3984007; Mon, 28 Jun 2021 13:23:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8863F3984007 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: =?UTF-8?B?W0J1ZyBsaWJzdGRjKysvMTAxMjM2XSBbMTIgUmVncmVzc2lvbl0g?= =?UTF-8?B?Yml0cy91bmlxdWVfcHRyLmg6NjU4OjQ4OiBlcnJvcjogaW52YWxpZCB1c2Ug?= =?UTF-8?B?b2YgaW5jb21wbGV0ZSB0eXBlIOKAmGNsYXNzIGxsdm06OkFQRmxvYXTigJkg?= =?UTF-8?B?c2luY2UgcjEyLTE3NzgtZzE3YmMzODQ4ZTA2NWMwOTgwNTIzZTFhMTU5MmYy?= =?UTF-8?B?ZjAzYjI0YjRmMWM=?= Date: Mon, 28 Jun 2021 13:23:39 +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: 12.0 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: 12.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, 28 Jun 2021 13:23:39 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101236 --- Comment #6 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:b7a89c041aa1d67654f1ba7b2839e221c3e14748 commit r12-1844-gb7a89c041aa1d67654f1ba7b2839e221c3e14748 Author: Jonathan Wakely Date: Mon Jun 28 12:59:19 2021 +0100 libstdc++: Allow unique_ptr::operator[] [PR 101236] PR libstdc++/101236 shows that LLVM depends on being able to use unique_ptr::operator[] when T is incomplete. This is undefined, but previously worked with libstdc++. When I added the conditional noexcept to that operator we started to diagnose the incomplete type. This change restores support for that case, by making the noexcept condition check that the type is complete before checking whether indexing on the pointer can throw. A workaround for PR c++/101239 is needed to avoid a bogus error where G++ fails to do SFINAE on the ill-formed p[n] expression and gets an ICE. Instead of checking that the p[n] expression is valid in the trailing-return-type, we only check that the element_type is complete. libstdc++-v3/ChangeLog: PR libstdc++/101236 * include/bits/unique_ptr.h (unique_ptr::operator[]): Fail gracefully if element_type is incomplete. * testsuite/20_util/unique_ptr/cons/incomplete.cc: Clarify that the standard doesn't require this test to work for array types. * testsuite/20_util/unique_ptr/lwg2762.cc: Check that incomplete types can be used with array specialization. * testsuite/20_util/unique_ptr/101236.cc: New test.=