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

--- Comment #21 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:fbc980d85149409ce62c22f48d3693113803929e

commit r14-7075-gfbc980d85149409ce62c22f48d3693113803929e
Author: waffl3x <waff...@protonmail.com>
Date:   Sun Jan 7 00:01:48 2024 +0000

    c++: P0847R7 (deducing this) - initial functionality. [PR102609]

    This implements the initial functionality for P0847R7.  CWG2789 is
    implemented, but instead of "same type" for the object parameters we take
    correspondence into account instead.  Without this alteration, the behavior
    here would be slightly different than the behavior with constrained member
    function templates, which I believe would be undesirable.

    There are a few outstanding issues related to xobj member functions
    overloading iobj member functions that are introduced by using
declarations.
    Unfortunately, fixing this will be a little more involved and will have to
    be pushed back until later.

    Most diagnostics have been split out into another patch to improve its
    clarity and allow all the strictly functional changes to be more
    distinct. Explicit object lambdas and CWG2586 are addressed in a follow up
    patch.

            PR c++/102609

    gcc/cp/ChangeLog:

            PR c++/102609
            C++23 P0847R7 (deducing this) - initial functionality.
            * class.cc (xobj_iobj_parameters_correspond): New function, checks
            for corresponding object parameters between xobj and iobj member
            functions.
            (add_method): Handle object parameters of xobj member functions,
use
            xobj_iobj_parameters_correspond.
            * call.cc (build_over_call): Refactor, handle xobj member
functions.
            (cand_parms_match): Handle object parameters of xobj and iobj
member
            functions, use xobj_iobj_parameters_correspond.
            * cp-tree.h (enum cp_decl_spec): Add ds_this, add comments.
            * decl.cc (grokfndecl): Add xobj_func_p parameter.  For xobj member
            functions, Set xobj_flag, don't set static_function flag.
            (grokdeclarator): Handle xobj member functions, tell grokfndecl.
            (grok_op_properties): Don't error for xobj operators.
            * parser.cc (cp_parser_decl_specifier_seq): Handle this specifier.
            (cp_parser_parameter_declaration): Set default argument to
            "this_identifier" for xobj parameters.
            (set_and_check_decl_spec_loc): Add "this", add comments.
            * tree.cc (build_min_non_dep_op_overload): Handle xobj operators.
            * typeck.cc (cp_build_addr_expr_1): Handle address-of xobj member
            functions.

    gcc/testsuite/ChangeLog:

            PR c++/102609
            C++23 P0847R7 (deducing this) - initial functionality.
            * g++.dg/cpp23/explicit-obj-basic1.C: New test.
            * g++.dg/cpp23/explicit-obj-basic2.C: New test.
            * g++.dg/cpp23/explicit-obj-basic3.C: New test.
            * g++.dg/cpp23/explicit-obj-basic4.C: New test.
            * g++.dg/cpp23/explicit-obj-basic5.C: New test.
            * g++.dg/cpp23/explicit-obj-by-value1.C: New test.
            * g++.dg/cpp23/explicit-obj-by-value2.C: New test.
            * g++.dg/cpp23/explicit-obj-by-value3.C: New test.
            * g++.dg/cpp23/explicit-obj-by-value4.C: New test.
            * g++.dg/cpp23/explicit-obj-constraints.C: New test.
            * g++.dg/cpp23/explicit-obj-constraints2.C: New test.
            * g++.dg/cpp23/explicit-obj-ops-mem-arrow.C: New test.
            * g++.dg/cpp23/explicit-obj-ops-mem-assignment.C: New test.
            * g++.dg/cpp23/explicit-obj-ops-mem-call.C: New test.
            * g++.dg/cpp23/explicit-obj-ops-mem-subscript.C: New test.
            * g++.dg/cpp23/explicit-obj-ops-non-mem-dep.C: New test.
            * g++.dg/cpp23/explicit-obj-ops-non-mem-non-dep.C: New test.
            * g++.dg/cpp23/explicit-obj-ops-non-mem.h: New test.
            * g++.dg/cpp23/explicit-obj-ops-requires-mem.C: New test.
            * g++.dg/cpp23/explicit-obj-ops-requires-non-mem.C: New test.
            * g++.dg/cpp23/explicit-obj-redecl.C: New test.
            * g++.dg/cpp23/explicit-obj-redecl2.C: New test.
            * g++.dg/cpp23/explicit-obj-redecl3.C: New test.
            * g++.dg/cpp23/explicit-obj-redecl4.C: New test.

    Signed-off-by: Waffl3x <waff...@protonmail.com>

Reply via email to