public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107684] New: [C++23] P2589 - static operator[]
@ 2022-11-14 18:22 mpolacek at gcc dot gnu.org
  2022-11-14 18:23 ` [Bug c++/107684] " mpolacek at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-11-14 18:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107684

            Bug ID: 107684
           Summary: [C++23] P2589 - static operator[]
           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/p2589>.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/107684] [C++23] P2589 - static operator[]
  2022-11-14 18:22 [Bug c++/107684] New: [C++23] P2589 - static operator[] mpolacek at gcc dot gnu.org
@ 2022-11-14 18:23 ` mpolacek at gcc dot gnu.org
  2022-11-14 18:24 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-11-14 18:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107684

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-11-14
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
             Blocks|                            |98940


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98940
[Bug 98940] Implement C++23 language features

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/107684] [C++23] P2589 - static operator[]
  2022-11-14 18:22 [Bug c++/107684] New: [C++23] P2589 - static operator[] mpolacek at gcc dot gnu.org
  2022-11-14 18:23 ` [Bug c++/107684] " mpolacek at gcc dot gnu.org
@ 2022-11-14 18:24 ` mpolacek at gcc dot gnu.org
  2022-11-19  9:25 ` jakub at gcc dot gnu.org
  2022-11-28 22:32 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-11-14 18:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107684

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Patch: https://gcc.gnu.org/pipermail/gcc-patches/2022-November/605705.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/107684] [C++23] P2589 - static operator[]
  2022-11-14 18:22 [Bug c++/107684] New: [C++23] P2589 - static operator[] mpolacek at gcc dot gnu.org
  2022-11-14 18:23 ` [Bug c++/107684] " mpolacek at gcc dot gnu.org
  2022-11-14 18:24 ` mpolacek at gcc dot gnu.org
@ 2022-11-19  9:25 ` jakub at gcc dot gnu.org
  2022-11-28 22:32 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-11-19  9:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107684

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
https://gcc.gnu.org/g:6492cec069bccf817ac5e984fb3eca407056a566

commit r13-4046-g6492cec069bccf817ac5e984fb3eca407056a566
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Tue Nov 15 08:00:21 2022 +0100

    c++: Implement C++23 P2589R1 - - static operator[]

    Here is a patch that implements the static operator[] paper.
    One thing that doesn't work properly is the same problem as I've filed
    yesterday for static operator() - PR107624 - that side-effects of
    the postfix-expression on which the call or subscript operator are
    applied are thrown away, I assume we have to add them into COMPOUND_EXPR
    somewhere after we find out that the we've chosen a static member function
    operator.

    2022-11-15  Jakub Jelinek  <jakub@redhat.com>

    gcc/c-family/
            * c-cppbuiltin.cc (c_cpp_builtins): Bump C++23
            __cpp_multidimensional_subscript macro value to 202211L.
    gcc/cp/
            * decl.cc (grok_op_properties): Implement C++23 P2589R1
            - static operator[].  Handle operator[] similarly to operator()
            - allow static member functions, but pedwarn on it for C++20 and
            older.  Unlike operator(), perform rest of checks on it though for
            C++20.
            * call.cc (add_operator_candidates): For operator[] with class
            typed first parameter, pass that parameter as first_arg and
            an adjusted arglist without that parameter.
    gcc/testsuite/
            * g++.dg/cpp23/subscript9.C: New test.
            * g++.dg/cpp23/feat-cxx2b.C: Expect a newer
            __cpp_multidimensional_subscript value.
            * g++.old-deja/g++.bugs/900210_10.C: Don't expect an error
            for C++23 or later.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/107684] [C++23] P2589 - static operator[]
  2022-11-14 18:22 [Bug c++/107684] New: [C++23] P2589 - static operator[] mpolacek at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-11-19  9:25 ` jakub at gcc dot gnu.org
@ 2022-11-28 22:32 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-28 22:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107684

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-28 22:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-14 18:22 [Bug c++/107684] New: [C++23] P2589 - static operator[] mpolacek at gcc dot gnu.org
2022-11-14 18:23 ` [Bug c++/107684] " mpolacek at gcc dot gnu.org
2022-11-14 18:24 ` mpolacek at gcc dot gnu.org
2022-11-19  9:25 ` jakub at gcc dot gnu.org
2022-11-28 22:32 ` 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).