public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.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 [thread overview] Message-ID: <bug-103049-4-lcMP2hti3d@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-103049-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103049 --- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>: https://gcc.gnu.org/g:93810fd673654db9ff16170624a6d36449eab241 commit r12-5386-g93810fd673654db9ff16170624a6d36449eab241 Author: Marek Polacek <polacek@redhat.com> 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.
next prev parent reply other threads:[~2021-11-18 23:01 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-11-02 16:53 [Bug c++/103049] New: " jakub at gcc dot gnu.org 2021-11-02 17:00 ` [Bug c++/103049] " mpolacek at gcc dot gnu.org 2021-11-02 17:26 ` mpolacek at gcc dot gnu.org 2021-11-09 19:43 ` mpolacek at gcc dot gnu.org 2021-11-09 21:07 ` webrown.cpp at gmail dot com 2021-11-09 21:16 ` mpolacek at gcc dot gnu.org 2021-11-09 21:25 ` jakub at gcc dot gnu.org 2021-11-09 21:33 ` redi at gcc dot gnu.org 2021-11-18 23:01 ` cvs-commit at gcc dot gnu.org [this message] 2021-11-18 23:11 ` mpolacek 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-103049-4-lcMP2hti3d@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: linkBe 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).