public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
* [Bug c++/107685] New: [C++23] P2647 - Permitting static constexpr variables in constexpr functions @ 2022-11-14 18:30 mpolacek at gcc dot gnu.org 2022-11-14 18:30 ` [Bug c++/107685] " mpolacek at gcc dot gnu.org ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: mpolacek at gcc dot gnu.org @ 2022-11-14 18:30 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107685 Bug ID: 107685 Summary: [C++23] P2647 - Permitting static constexpr variables in constexpr functions Product: gcc Version: unknown 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/p2647>. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/107685] [C++23] P2647 - Permitting static constexpr variables in constexpr functions 2022-11-14 18:30 [Bug c++/107685] New: [C++23] P2647 - Permitting static constexpr variables in constexpr functions mpolacek at gcc dot gnu.org @ 2022-11-14 18:30 ` mpolacek at gcc dot gnu.org 2022-11-19 9:21 ` jakub at gcc dot gnu.org 2022-11-28 22:31 ` pinskia at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: mpolacek at gcc dot gnu.org @ 2022-11-14 18:30 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107685 Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2022-11-14 Blocks| |98940 Ever confirmed|0 |1 --- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Patch: <https://gcc.gnu.org/pipermail/gcc-patches/2022-November/605773.html>. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98940 [Bug 98940] Implement C++23 language features ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/107685] [C++23] P2647 - Permitting static constexpr variables in constexpr functions 2022-11-14 18:30 [Bug c++/107685] New: [C++23] P2647 - Permitting static constexpr variables in constexpr functions mpolacek at gcc dot gnu.org 2022-11-14 18:30 ` [Bug c++/107685] " mpolacek at gcc dot gnu.org @ 2022-11-19 9:21 ` jakub at gcc dot gnu.org 2022-11-28 22:31 ` pinskia at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: jakub at gcc dot gnu.org @ 2022-11-19 9:21 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107685 Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- https://gcc.gnu.org/g:32d16fe9d7e347bc58e7fad316ed7923e1d0f65c commit r13-4161-g32d16fe9d7e347bc58e7fad316ed7923e1d0f65c Author: Jakub Jelinek <jakub@redhat.com> Date: Sat Nov 19 09:26:44 2022 +0100 c++: Implement C++23 P2647R1 - Permitting static constexpr variables in constexpr functions The following patch implements this paper. Per further discussions it is implemented for C++23 only, so isn't treated as a DR, e.g. because the part of the standard the paper is changing didn't even exist in C++20. And we gave up on trying to implement it as a pedwarn rather than error for C++20 and older, because of implicit constexpr lambdas or -fimplicit-constexpr reasons. For C++20 and older, the only change is that passing through definitions of static or thread_local vars usable in constant expressions is now accepted in statement expressions if they aren't inside of constexpr or consteval functions. 2022-11-19 Jakub Jelinek <jakub@redhat.com> gcc/c-family/ * c-cppbuiltin.cc (c_cpp_builtins): Bump __cpp_constexpr value from 202207L to 202211L. gcc/cp/ * constexpr.cc (cxx_eval_constant_expression): Implement C++23 P2647R1 - Permitting static constexpr variables in constexpr functions. Allow DECL_EXPRs of decl_constant_var_p static or thread_local vars. (potential_constant_expression_1): Similarly, except use decl_maybe_constant_var_p instead of decl_constant_var_p if processing_template_decl. gcc/testsuite/ * g++.dg/cpp23/constexpr-nonlit17.C: New test. * g++.dg/cpp23/constexpr-nonlit18.C: New test. * g++.dg/cpp23/feat-cxx2b.C: Adjust expected __cpp_constexpr value. * g++.dg/ext/stmtexpr19.C: Don't expect an error. * g++.dg/ext/stmtexpr25.C: New test. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/107685] [C++23] P2647 - Permitting static constexpr variables in constexpr functions 2022-11-14 18:30 [Bug c++/107685] New: [C++23] P2647 - Permitting static constexpr variables in constexpr functions mpolacek at gcc dot gnu.org 2022-11-14 18:30 ` [Bug c++/107685] " mpolacek at gcc dot gnu.org 2022-11-19 9:21 ` jakub at gcc dot gnu.org @ 2022-11-28 22:31 ` pinskia at gcc dot gnu.org 2 siblings, 0 replies; 4+ messages in thread From: pinskia at gcc dot gnu.org @ 2022-11-28 22:31 UTC (permalink / raw) To: gcc-bugs https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107685 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |13.0 ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-11-28 22:31 UTC | newest] Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-11-14 18:30 [Bug c++/107685] New: [C++23] P2647 - Permitting static constexpr variables in constexpr functions mpolacek at gcc dot gnu.org 2022-11-14 18:30 ` [Bug c++/107685] " mpolacek at gcc dot gnu.org 2022-11-19 9:21 ` jakub at gcc dot gnu.org 2022-11-28 22:31 ` pinskia 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).