From: Marek Polacek <polacek@redhat.com>
To: Patrick Palka <ppalka@redhat.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] c++: remove COMPOUND_EXPR_OVERLOADED flag
Date: Fri, 10 Dec 2021 11:01:58 -0500 [thread overview]
Message-ID: <YbN59pa+QpEZCni4@redhat.com> (raw)
In-Reply-To: <20211210154800.2903317-1-ppalka@redhat.com>
On Fri, Dec 10, 2021 at 10:48:00AM -0500, Patrick Palka via Gcc-patches wrote:
> This flag is never set because non-dependent COMPOUND_EXPRs are fully
> resolved into a CALL_EXPR at template definition time (in
> build_x_compound_expr) ever since r6-5772.
>
> Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for
> trunk?
LGTM.
> gcc/cp/ChangeLog:
>
> * cp-tree.h (COMPOUND_EXPR_OVERLOADED): Remove.
> * pt.c (build_non_dependent_expr): Don't inspect this flag.
> * tree.c (build_min_non_dep): Don't set this flag.
> ---
> gcc/cp/cp-tree.h | 6 ------
> gcc/cp/pt.c | 3 +--
> gcc/cp/tree.c | 5 -----
> 3 files changed, 1 insertion(+), 13 deletions(-)
>
> diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
> index b1c3bc5ed1f..e4330fb1f8b 100644
> --- a/gcc/cp/cp-tree.h
> +++ b/gcc/cp/cp-tree.h
> @@ -404,7 +404,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
> NEW_EXPR_USE_GLOBAL (in NEW_EXPR).
> COND_EXPR_IS_VEC_DELETE (in COND_EXPR).
> DELETE_EXPR_USE_GLOBAL (in DELETE_EXPR).
> - COMPOUND_EXPR_OVERLOADED (in COMPOUND_EXPR).
> CLEANUP_P (in TRY_BLOCK)
> AGGR_INIT_VIA_CTOR_P (in AGGR_INIT_EXPR)
> PTRMEM_OK_P (in ADDR_EXPR, OFFSET_REF, SCOPE_REF)
> @@ -4015,11 +4014,6 @@ struct GTY(()) lang_decl {
> #define CALL_OR_AGGR_INIT_CHECK(NODE) \
> TREE_CHECK2 ((NODE), CALL_EXPR, AGGR_INIT_EXPR)
>
> -/* Indicates that this is a non-dependent COMPOUND_EXPR which will
> - resolve to a function call. */
> -#define COMPOUND_EXPR_OVERLOADED(NODE) \
> - TREE_LANG_FLAG_0 (COMPOUND_EXPR_CHECK (NODE))
> -
> /* In a CALL_EXPR appearing in a template, true if Koenig lookup
> should be performed at instantiation time. */
> #define KOENIG_LOOKUP_P(NODE) TREE_LANG_FLAG_0 (CALL_EXPR_CHECK (NODE))
> diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
> index 9834baf34db..cbdb4b566aa 100644
> --- a/gcc/cp/pt.c
> +++ b/gcc/cp/pt.c
> @@ -28373,8 +28373,7 @@ build_non_dependent_expr (tree expr)
> ? build_non_dependent_expr (TREE_OPERAND (expr, 1))
> : build_non_dependent_expr (TREE_OPERAND (expr, 0))),
> build_non_dependent_expr (TREE_OPERAND (expr, 2)));
> - if (TREE_CODE (expr) == COMPOUND_EXPR
> - && !COMPOUND_EXPR_OVERLOADED (expr))
> + if (TREE_CODE (expr) == COMPOUND_EXPR)
> return build2 (COMPOUND_EXPR,
> TREE_TYPE (expr),
> TREE_OPERAND (expr, 0),
> diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
> index 52c56831f98..f6f7927f293 100644
> --- a/gcc/cp/tree.c
> +++ b/gcc/cp/tree.c
> @@ -3577,11 +3577,6 @@ build_min_non_dep (enum tree_code code, tree non_dep, ...)
> for (i = 0; i < length; i++)
> TREE_OPERAND (t, i) = va_arg (p, tree);
>
> - if (code == COMPOUND_EXPR && TREE_CODE (non_dep) != COMPOUND_EXPR)
> - /* This should not be considered a COMPOUND_EXPR, because it
> - resolves to an overload. */
> - COMPOUND_EXPR_OVERLOADED (t) = 1;
> -
> va_end (p);
> return convert_from_reference (t);
> }
> --
> 2.34.1.75.gabe6bb3905
>
Marek
next prev parent reply other threads:[~2021-12-10 16:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-10 15:48 Patrick Palka
2021-12-10 15:55 ` Patrick Palka
2021-12-10 16:01 ` Marek Polacek [this message]
2021-12-13 15:04 ` Jason Merrill
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=YbN59pa+QpEZCni4@redhat.com \
--to=polacek@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=ppalka@redhat.com \
/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).