From: Jakub Jelinek <jakub@redhat.com>
To: Mark Mitchell <mark@codesourcery.com>
Cc: Jason Merrill <jason@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: C++ patch ping
Date: Mon, 28 Apr 2008 20:43:00 -0000 [thread overview]
Message-ID: <20080428172015.GW2255@devserv.devel.redhat.com> (raw)
In-Reply-To: <4816041B.9060300@codesourcery.com>
On Mon, Apr 28, 2008 at 10:06:35AM -0700, Mark Mitchell wrote:
> Jakub Jelinek wrote:
>
> >- http://gcc.gnu.org/ml/gcc-patches/2008-04/msg01609.html PR c++/35650
>
> I think this patch is OK. As you say, we could also change
Thanks.
> >- http://gcc.gnu.org/ml/gcc-patches/2008-04/msg01559.html PR c++/35987
>
> This is OK, too, though I would prefer using error_operand_p to the
> direct comparision with error_mark_node. In this case, error_mark_node
> is probably correct -- but using error_operand_p for expressions is more
> mnemonic.
cp_build_modify_expr starts with:
/* Avoid duplicate error messages from operands that had errors. */
if (error_operand_p (lhs) || error_operand_p (rhs))
return error_mark_node;
so it should turn many results
res != error_mark_node && TREE_TYPE (res) == error_mark_node
into error_mark_node. And the following cases also use direct
error_mark_node comparison:
/* Handle (a, b) used as an "lvalue". */
case COMPOUND_EXPR:
newrhs = cp_build_modify_expr (TREE_OPERAND (lhs, 1),
modifycode, rhs, complain);
if (newrhs == error_mark_node)
^^^^ here
return error_mark_node;
return build2 (COMPOUND_EXPR, lhstype,
TREE_OPERAND (lhs, 0), newrhs);
case MODIFY_EXPR:
if (TREE_SIDE_EFFECTS (TREE_OPERAND (lhs, 0)))
lhs = build2 (TREE_CODE (lhs), TREE_TYPE (lhs),
stabilize_reference (TREE_OPERAND (lhs, 0)),
TREE_OPERAND (lhs, 1));
newrhs = cp_build_modify_expr (TREE_OPERAND (lhs, 0), modifycode, rhs,
complain);
if (newrhs == error_mark_node)
^^^^ and here
return error_mark_node;
return build2 (COMPOUND_EXPR, lhstype, lhs, newrhs);
(and later code in the function does similarly).
So, if I should use error_operand_p instead, I guess it should be changed
consistently for all 3 cases, or none.
Jakub
next prev parent reply other threads:[~2008-04-28 17:22 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-28 20:18 Jakub Jelinek
2008-04-28 20:43 ` Mark Mitchell
2008-04-28 20:43 ` Jakub Jelinek [this message]
2008-04-28 20:59 ` Mark Mitchell
-- strict thread matches above, loose matches on Subject: below --
2024-04-03 9:48 C++ Patch ping Jakub Jelinek
2024-03-08 8:56 [PATCH] c++: Fix constexpr evaluation of parameters passed by invisible reference [PR111284] Jakub Jelinek
2024-03-25 18:27 ` C++ Patch ping Jakub Jelinek
2024-03-06 14:12 C++ patch ping Jakub Jelinek
2023-09-19 7:19 Jakub Jelinek
2022-03-02 9:46 Jakub Jelinek
2021-08-30 7:11 Jakub Jelinek
2021-09-01 19:25 ` Jason Merrill
2021-09-01 20:11 ` Jakub Jelinek
2021-09-01 21:46 ` Jason Merrill
2021-08-16 17:37 C++ Patch ping Jakub Jelinek
2021-07-27 16:09 Jakub Jelinek
2021-01-05 16:34 Jakub Jelinek
2021-01-05 20:53 ` Jason Merrill
2020-12-03 13:59 C++ patch ping Jakub Jelinek
2020-11-09 19:24 Jakub Jelinek
2020-10-29 14:14 Jakub Jelinek
2020-03-16 15:45 C++ Patch ping Jakub Jelinek
2019-11-18 15:32 C++ patch ping Jakub Jelinek
2018-12-04 14:47 Jakub Jelinek
2018-12-06 21:43 ` Jason Merrill
2018-07-13 13:49 Jakub Jelinek
2018-07-13 16:24 ` Nathan Sidwell
2018-07-13 16:53 ` Jakub Jelinek
2018-07-13 16:42 ` Nathan Sidwell
2018-01-31 16:05 Jakub Jelinek
2018-01-02 15:12 Jakub Jelinek
2017-12-08 13:42 Jakub Jelinek
2017-09-27 10:05 Jakub Jelinek
2017-09-22 14:36 Jakub Jelinek
2017-02-06 14:13 Jakub Jelinek
2016-12-21 11:50 Jakub Jelinek
2016-12-15 8:38 C++ Patch Ping Jakub Jelinek
2016-12-15 12:26 ` Nathan Sidwell
2016-12-15 12:38 ` Jakub Jelinek
2016-12-15 12:48 ` Nathan Sidwell
2016-09-05 15:13 C++ patch ping Jakub Jelinek
2016-01-09 7:41 Jakub Jelinek
2016-01-11 20:01 ` Nathan Sidwell
2016-01-11 21:45 ` Jason Merrill
2016-01-11 21:52 ` Jakub Jelinek
2016-01-11 22:04 ` Jason Merrill
2016-01-11 23:53 ` Jakub Jelinek
2016-01-12 5:21 ` Jason Merrill
2005-02-11 14:44 Giovanni Bajo
2005-02-18 12:21 ` Mark Mitchell
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=20080428172015.GW2255@devserv.devel.redhat.com \
--to=jakub@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.com \
--cc=mark@codesourcery.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).