public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c++/114458] New: [C++26] P2573R2 - = delete("reason"); @ 2024-03-25 11:11 jakub at gcc dot gnu.org 2024-03-25 17:22 ` [Bug c++/114458] " jakub at gcc dot gnu.org ` (4 more replies) 0 siblings, 5 replies; 6+ messages in thread From: jakub at gcc dot gnu.org @ 2024-03-25 11:11 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114458 Bug ID: 114458 Summary: [C++26] P2573R2 - = delete("reason"); Product: gcc Version: 14.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/P2573R2>. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/114458] [C++26] P2573R2 - = delete("reason"); 2024-03-25 11:11 [Bug c++/114458] New: [C++26] P2573R2 - = delete("reason"); jakub at gcc dot gnu.org @ 2024-03-25 17:22 ` jakub at gcc dot gnu.org 2024-03-25 18:07 ` pinskia at gcc dot gnu.org ` (3 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: jakub at gcc dot gnu.org @ 2024-03-25 17:22 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114458 --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Considering taking this for stage1 as well. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/114458] [C++26] P2573R2 - = delete("reason"); 2024-03-25 11:11 [Bug c++/114458] New: [C++26] P2573R2 - = delete("reason"); jakub at gcc dot gnu.org 2024-03-25 17:22 ` [Bug c++/114458] " jakub at gcc dot gnu.org @ 2024-03-25 18:07 ` pinskia at gcc dot gnu.org 2024-04-30 17:47 ` jakub at gcc dot gnu.org ` (2 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: pinskia at gcc dot gnu.org @ 2024-03-25 18:07 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114458 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2024-03-25 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 --- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- . ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/114458] [C++26] P2573R2 - = delete("reason"); 2024-03-25 11:11 [Bug c++/114458] New: [C++26] P2573R2 - = delete("reason"); jakub at gcc dot gnu.org 2024-03-25 17:22 ` [Bug c++/114458] " jakub at gcc dot gnu.org 2024-03-25 18:07 ` pinskia at gcc dot gnu.org @ 2024-04-30 17:47 ` jakub at gcc dot gnu.org 2024-05-02 7:35 ` cvs-commit at gcc dot gnu.org 2024-05-02 7:40 ` jakub at gcc dot gnu.org 4 siblings, 0 replies; 6+ messages in thread From: jakub at gcc dot gnu.org @ 2024-04-30 17:47 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114458 Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 58078 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58078&action=edit gcc15-pr114458.patch Untested implementation. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/114458] [C++26] P2573R2 - = delete("reason"); 2024-03-25 11:11 [Bug c++/114458] New: [C++26] P2573R2 - = delete("reason"); jakub at gcc dot gnu.org ` (2 preceding siblings ...) 2024-04-30 17:47 ` jakub at gcc dot gnu.org @ 2024-05-02 7:35 ` cvs-commit at gcc dot gnu.org 2024-05-02 7:40 ` jakub at gcc dot gnu.org 4 siblings, 0 replies; 6+ messages in thread From: cvs-commit at gcc dot gnu.org @ 2024-05-02 7:35 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114458 --- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:2f15787f2e1a3afe2c2ad93d4eb0d3c1f73c8fbd commit r15-105-g2f15787f2e1a3afe2c2ad93d4eb0d3c1f73c8fbd Author: Jakub Jelinek <jakub@redhat.com> Date: Thu May 2 09:34:31 2024 +0200 c++: Implement C++26 P2573R2 - = delete("should have a reason"); [PR114458] The following patch implements the C++26 P2573R2 = delete("should have a reason"); paper. I've tried to avoid increasing compile time memory for it when it isn't used (e.g. by adding a new lang_decl tree member), so the reason is represented as STRING_CST in DECL_INITIAL (which normally is for DECL_DELETED_FN error_mark_node) and to differentiate this delete("reason") initializer from some bogus attempt to initialize a function with "reason" using the RID_DELETE identifier as TREE_TYPE of the STRING_CST, as nothing needs to care about the type of the reason. If preferred it could be say TREE_LIST with the reason STRING_CST and RID_DELETE identifier or something similar instead, but that would need more compile time memory when it is used. 2024-05-02 Jakub Jelinek <jakub@redhat.com> PR c++/114458 gcc/c-family/ * c-cppbuiltin.cc (c_cpp_builtins): Predefine __cpp_deleted_function=202403L for C++26. gcc/cp/ChangeLog * parser.cc (cp_parser_pure_specifier): Implement C++26 P2573R2 - = delete("should have a reason");. Parse deleted-function-body. * decl.cc (duplicate_decls): Copy DECL_INITIAL from DECL_DELETED_FN olddecl to newdecl if it is a STRING_CST. (cp_finish_decl): Handle deleted init with a reason. * decl2.cc: Include "escaped_string.h". (grokfield): Handle deleted init with a reason. (mark_used): Emit DECL_DELETED_FN reason in the message if any. * cp-tree.h (DECL_DELETED_FN): Document representation of = delete("reason") on a DECL. gcc/testsuite/ * g++.dg/cpp26/feat-cxx26.C (__cpp_deleted_function): Add test. * g++.dg/cpp26/delete-reason1.C: New test. * g++.dg/cpp26/delete-reason2.C: New test. * g++.dg/parse/error65.C (f1): Adjust expected diagnostics. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/114458] [C++26] P2573R2 - = delete("reason"); 2024-03-25 11:11 [Bug c++/114458] New: [C++26] P2573R2 - = delete("reason"); jakub at gcc dot gnu.org ` (3 preceding siblings ...) 2024-05-02 7:35 ` cvs-commit at gcc dot gnu.org @ 2024-05-02 7:40 ` jakub at gcc dot gnu.org 4 siblings, 0 replies; 6+ messages in thread From: jakub at gcc dot gnu.org @ 2024-05-02 7:40 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114458 Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED --- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Implemented for GCC 15+. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-05-02 7:40 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2024-03-25 11:11 [Bug c++/114458] New: [C++26] P2573R2 - = delete("reason"); jakub at gcc dot gnu.org 2024-03-25 17:22 ` [Bug c++/114458] " jakub at gcc dot gnu.org 2024-03-25 18:07 ` pinskia at gcc dot gnu.org 2024-04-30 17:47 ` jakub at gcc dot gnu.org 2024-05-02 7:35 ` cvs-commit at gcc dot gnu.org 2024-05-02 7:40 ` jakub 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).