public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/107684] [C++23] P2589 - static operator[]
Date: Sat, 19 Nov 2022 09:25:32 +0000	[thread overview]
Message-ID: <bug-107684-4-j7qZ0IuQ75@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107684-4@http.gcc.gnu.org/bugzilla/>

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.

  parent reply	other threads:[~2022-11-19  9:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-14 18:22 [Bug c++/107684] New: " 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 [this message]
2022-11-28 22:32 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-107684-4-j7qZ0IuQ75@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).