From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1215F3857814; Thu, 18 Nov 2021 23:01:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1215F3857814 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/103049] [C++23] P0849R8 - auto(x): decay-copy in the language Date: Thu, 18 Nov 2021 23:01:31 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: patch 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: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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: Thu, 18 Nov 2021 23:01:31 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103049 --- Comment #6 from CVS Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:93810fd673654db9ff16170624a6d36449eab241 commit r12-5386-g93810fd673654db9ff16170624a6d36449eab241 Author: Marek Polacek Date: Wed Nov 3 11:04:22 2021 -0400 c++: Implement C++23 P0849R8 - auto(x) [PR103049] This patch implements P0849R8 which allows auto in a functional cast, the result of which is a prvalue. [expr.type.conv]/1 says that the type is determined by placeholder type deduction. We only accept 'auto', not 'decltype(auto)' -- that the type shall be auto comes from [dcl.type.auto.deduct]. Therefore the rules are like for [temp.deduct.call], deducing template arguments from a function call, so the result type will never be a reference, and we decay arrays/functions. PR c++/103049 gcc/cp/ChangeLog: * semantics.c (finish_compound_literal): Accept C++23 auto{x}. * typeck2.c (build_functional_cast_1): Accept C++23 auto(x). gcc/testsuite/ChangeLog: * g++.dg/cpp0x/auto25.C: Adjust dg-error. * g++.dg/cpp0x/auto9.C: Likewise. * g++.dg/cpp2a/concepts-pr84979-2.C: Likewise. * g++.dg/cpp2a/concepts-pr84979-3.C: Likewise. * g++.dg/cpp23/auto-fncast1.C: New test. * g++.dg/cpp23/auto-fncast2.C: New test. * g++.dg/cpp23/auto-fncast3.C: New test. * g++.dg/cpp23/auto-fncast4.C: New test. * g++.dg/cpp23/auto-fncast5.C: New test. * g++.dg/cpp23/auto-fncast6.C: New test.=