public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c++/110342] New: [C++26] P2361R6 - Unevaluated strings @ 2023-06-21 16:10 mpolacek at gcc dot gnu.org 2023-06-22 6:18 ` [Bug c++/110342] " pinskia at gcc dot gnu.org ` (4 more replies) 0 siblings, 5 replies; 6+ messages in thread From: mpolacek at gcc dot gnu.org @ 2023-06-21 16:10 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110342 Bug ID: 110342 Summary: [C++26] P2361R6 - Unevaluated strings Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mpolacek at gcc dot gnu.org Target Milestone: --- See <https://wg21.link/P2361R6>. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/110342] [C++26] P2361R6 - Unevaluated strings 2023-06-21 16:10 [Bug c++/110342] New: [C++26] P2361R6 - Unevaluated strings mpolacek at gcc dot gnu.org @ 2023-06-22 6:18 ` pinskia at gcc dot gnu.org 2023-08-23 11:47 ` jakub at gcc dot gnu.org ` (3 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: pinskia at gcc dot gnu.org @ 2023-06-22 6:18 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110342 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2023-06-22 Ever confirmed|0 |1 --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Confirmed. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/110342] [C++26] P2361R6 - Unevaluated strings 2023-06-21 16:10 [Bug c++/110342] New: [C++26] P2361R6 - Unevaluated strings mpolacek at gcc dot gnu.org 2023-06-22 6:18 ` [Bug c++/110342] " pinskia at gcc dot gnu.org @ 2023-08-23 11:47 ` jakub at gcc dot gnu.org 2023-08-24 7:44 ` de34 at live dot cn ` (2 subsequent siblings) 4 siblings, 0 replies; 6+ messages in thread From: jakub at gcc dot gnu.org @ 2023-08-23 11:47 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110342 Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org Status|NEW |ASSIGNED --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 55779 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55779&action=edit gcc14-pr110342.patch Untested implementation. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/110342] [C++26] P2361R6 - Unevaluated strings 2023-06-21 16:10 [Bug c++/110342] New: [C++26] P2361R6 - Unevaluated strings mpolacek at gcc dot gnu.org 2023-06-22 6:18 ` [Bug c++/110342] " pinskia at gcc dot gnu.org 2023-08-23 11:47 ` jakub at gcc dot gnu.org @ 2023-08-24 7:44 ` de34 at live dot cn 2023-11-02 6:46 ` cvs-commit at gcc dot gnu.org 2023-11-02 6:48 ` jakub at gcc dot gnu.org 4 siblings, 0 replies; 6+ messages in thread From: de34 at live dot cn @ 2023-08-24 7:44 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110342 Jiang An <de34 at live dot cn> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |de34 at live dot cn --- Comment #3 from Jiang An <de34 at live dot cn> --- It seems that the paper also makes the GNU assembly syntax conforming. Should we make some other changes? ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/110342] [C++26] P2361R6 - Unevaluated strings 2023-06-21 16:10 [Bug c++/110342] New: [C++26] P2361R6 - Unevaluated strings mpolacek at gcc dot gnu.org ` (2 preceding siblings ...) 2023-08-24 7:44 ` de34 at live dot cn @ 2023-11-02 6:46 ` cvs-commit at gcc dot gnu.org 2023-11-02 6:48 ` jakub at gcc dot gnu.org 4 siblings, 0 replies; 6+ messages in thread From: cvs-commit at gcc dot gnu.org @ 2023-11-02 6:46 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110342 --- Comment #4 from CVS 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:1c58566450f21cf1d9951284176ea6da0cc11fc9 commit r14-5071-g1c58566450f21cf1d9951284176ea6da0cc11fc9 Author: Jakub Jelinek <jakub@redhat.com> Date: Thu Nov 2 07:44:24 2023 +0100 c++: Implement C++26 P2361R6 - Unevaluated strings [PR110342] The following patch implements C++26 unevaluated-string. As it seems to me just extra pedanticity, it is implemented only for -std=c++26 or -std=gnu++26 and later and only if -pedantic/-pedantic-errors. Nothing is done for inline asm, while the spec changes those, it changes it to a balanced token sequence with implementation defined rules on what is and isn't allowed (so pedantically accepting asm ("" : "+m" (x)); was accepts-invalid before C++26, but we didn't diagnose anything). For the other spots mentioned in the paper, static_assert message, linkage specification, deprecated/nodiscard attributes it enforces the requirements (no prefixes, udlit suffixes, no octal/hexadecimal escapes (conditional escape sequences were rejected with pedantic already before). For the deprecated operator "" identifier case I've kept things as is, because everything seems to have been diagnosed already (a lot being implied from the string having to be empty). 2023-11-02 Jakub Jelinek <jakub@redhat.com> PR c++/110342 gcc/cp/ * parser.cc: Implement C++26 P2361R6 - Unevaluated strings. (uneval_string_attr): New enumerator. (cp_parser_string_literal_common): Add UNEVAL argument. If true, pass CPP_UNEVAL_STRING rather than CPP_STRING to cpp_interpret_string_notranslate. (cp_parser_string_literal, cp_parser_userdef_string_literal): Adjust callers of cp_parser_string_literal_common. (cp_parser_unevaluated_string_literal): New function. (cp_parser_parenthesized_expression_list): Handle uneval_string_attr. (cp_parser_linkage_specification): Use cp_parser_unevaluated_string_literal for C++26. (cp_parser_static_assert): Likewise. (cp_parser_std_attribute): Use uneval_string_attr for standard deprecated and nodiscard attributes. gcc/testsuite/ * g++.dg/cpp26/unevalstr1.C: New test. * g++.dg/cpp26/unevalstr2.C: New test. * g++.dg/cpp0x/udlit-error1.C (lol): Expect an error for C++26 about user-defined literal in deprecated attribute. libcpp/ * include/cpplib.h (TTYPE_TABLE): Add CPP_UNEVAL_STRING literal entry. Use C++11 instead of C++-0x in comments. * charset.cc (convert_escape): Add UNEVAL argument, if true, pedantically diagnose numeric escape sequences. (cpp_interpret_string_1): Formatting fix. Adjust convert_escape caller. (cpp_interpret_string): Formatting string. (cpp_interpret_string_notranslate): Pass type through to cpp_interpret_string if it is CPP_UNEVAL_STRING. ^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/110342] [C++26] P2361R6 - Unevaluated strings 2023-06-21 16:10 [Bug c++/110342] New: [C++26] P2361R6 - Unevaluated strings mpolacek at gcc dot gnu.org ` (3 preceding siblings ...) 2023-11-02 6:46 ` cvs-commit at gcc dot gnu.org @ 2023-11-02 6:48 ` jakub at gcc dot gnu.org 4 siblings, 0 replies; 6+ messages in thread From: jakub at gcc dot gnu.org @ 2023-11-02 6:48 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110342 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 now. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-11-02 6:48 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-06-21 16:10 [Bug c++/110342] New: [C++26] P2361R6 - Unevaluated strings mpolacek at gcc dot gnu.org 2023-06-22 6:18 ` [Bug c++/110342] " pinskia at gcc dot gnu.org 2023-08-23 11:47 ` jakub at gcc dot gnu.org 2023-08-24 7:44 ` de34 at live dot cn 2023-11-02 6:46 ` cvs-commit at gcc dot gnu.org 2023-11-02 6:48 ` 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).