public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/103049] New: [C++23] P0849R8 - auto(x): decay-copy in the language
@ 2021-11-02 16:53 jakub at gcc dot gnu.org
2021-11-02 17:00 ` [Bug c++/103049] " mpolacek at gcc dot gnu.org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-11-02 16:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103049
Bug ID: 103049
Summary: [C++23] P0849R8 - auto(x): decay-copy in the language
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
See https://wg21.link/p849r8
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/103049] [C++23] P0849R8 - auto(x): decay-copy in the language
2021-11-02 16:53 [Bug c++/103049] New: [C++23] P0849R8 - auto(x): decay-copy in the language jakub at gcc dot gnu.org
@ 2021-11-02 17:00 ` mpolacek at gcc dot gnu.org
2021-11-02 17:26 ` mpolacek at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-11-02 17:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103049
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
CC| |mpolacek at gcc dot gnu.org
Ever confirmed|0 |1
Last reconfirmed| |2021-11-02
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/103049] [C++23] P0849R8 - auto(x): decay-copy in the language
2021-11-02 16:53 [Bug c++/103049] New: [C++23] P0849R8 - auto(x): decay-copy in the language 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
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-11-02 17:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103049
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/103049] [C++23] P0849R8 - auto(x): decay-copy in the language
2021-11-02 16:53 [Bug c++/103049] New: [C++23] P0849R8 - auto(x): decay-copy in the language 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
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-11-09 19:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103049
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Patch on review.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/103049] [C++23] P0849R8 - auto(x): decay-copy in the language
2021-11-02 16:53 [Bug c++/103049] New: [C++23] P0849R8 - auto(x): decay-copy in the language jakub at gcc dot gnu.org
` (2 preceding siblings ...)
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
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: webrown.cpp at gmail dot com @ 2021-11-09 21:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103049
--- Comment #2 from W E Brown <webrown.cpp at gmail dot com> ---
(In reply to Marek Polacek from comment #1)
> Patch on review.
In the proposed patch, I respectfully recommend a slight rewording of the new
pedwarn messages in gcc/cp/semantics.c and gcc/cp/typeck2.c:
either s/only available with/available only with/
or s/only available with/unavailable without/
or s/only available with/requires/
would emphasize the required flag rather than focus on the feature's
availability. (FWIW, of the above suggestions, the last ["requires"] seems to
me the most direct and simplest to understand.)
Thank you.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/103049] [C++23] P0849R8 - auto(x): decay-copy in the language
2021-11-02 16:53 [Bug c++/103049] New: [C++23] P0849R8 - auto(x): decay-copy in the language jakub at gcc dot gnu.org
` (3 preceding siblings ...)
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
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-11-09 21:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103049
--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I'm afraid "only available with" is the customary form we use throughout the
front end, so in the patch I'm just sticking to that form.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/103049] [C++23] P0849R8 - auto(x): decay-copy in the language
2021-11-02 16:53 [Bug c++/103049] New: [C++23] P0849R8 - auto(x): decay-copy in the language jakub at gcc dot gnu.org
` (4 preceding siblings ...)
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
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-11-09 21:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103049
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Yeah. If we change the wording, we should change it consistently, and perhaps
it would be useful to do that because the current wording suggests only a
single pair of -std= options, while we mean that level and anything later (I
don't think we have something supported std >= 11 && std <= 17 or similar ATM,
just >= version or <= version).
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/103049] [C++23] P0849R8 - auto(x): decay-copy in the language
2021-11-02 16:53 [Bug c++/103049] New: [C++23] P0849R8 - auto(x): decay-copy in the language jakub at gcc dot gnu.org
` (5 preceding siblings ...)
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
2021-11-18 23:11 ` mpolacek at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2021-11-09 21:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103049
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=93769
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
PR 93769 covers pretty much the same topic.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/103049] [C++23] P0849R8 - auto(x): decay-copy in the language
2021-11-02 16:53 [Bug c++/103049] New: [C++23] P0849R8 - auto(x): decay-copy in the language jakub at gcc dot gnu.org
` (6 preceding siblings ...)
2021-11-09 21:33 ` redi at gcc dot gnu.org
@ 2021-11-18 23:01 ` cvs-commit at gcc dot gnu.org
2021-11-18 23:11 ` mpolacek at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-18 23:01 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/103049] [C++23] P0849R8 - auto(x): decay-copy in the language
2021-11-02 16:53 [Bug c++/103049] New: [C++23] P0849R8 - auto(x): decay-copy in the language jakub at gcc dot gnu.org
` (7 preceding siblings ...)
2021-11-18 23:01 ` cvs-commit at gcc dot gnu.org
@ 2021-11-18 23:11 ` mpolacek at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-11-18 23:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103049
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Implemented in GCC 12.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2021-11-18 23:11 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-02 16:53 [Bug c++/103049] New: [C++23] P0849R8 - auto(x): decay-copy in the language 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
2021-11-18 23:11 ` mpolacek at gcc dot gnu.org
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).