This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH]: Fix 11295 - Make statement exprs work properly inC++
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: Mark Mitchell <mitchell at codesourcery dot com>, gcc-patches at gcc dot gnu dot org
- Date: 31 Jul 2003 17:14:38 -0700
- Subject: Re: [C++ PATCH]: Fix 11295 - Make statement exprs work properly inC++
- References: <3F280401.6000505@codesourcery.com>
On Wed, 2003-07-30 at 10:44, Nathan Sidwell wrote:
> Hi,
> This patch makes statement expressions function properly with C++.
> Statement expressions did not behave correctly for non-pod types. This
> patch makes them work in a similar manner to a function returning
> a struct by value - a TARGET_EXPR is build whose initializer is the
> statement-expression.
>
> The awkardness with tf_stmt_expr and tf_stmt_exprs occurs because
> a STMT_EXPR simply contains a COMPOUND_STMT, rather than a list
> of statements and a separate 'result statement'. The STMT_EXPR
> machinery can know it is supposed to wrap things in a scope etc.
This patch is OK.
However:
+ tf_stmt_expr = 1 << 6, /* tsubsting the statement of a
statement
+ expr. */
+ tf_stmt_exprs = 1 << 7 /* tsubsting the statements of a
statement
+ expr. */
"the statement" vs "the statements" isn't terribly clear to me and the
names are "expr" vs "exprs" which seems like the number of expressions
is what's changing. Are there names we could use that would be more
obviously distinct?
Thanks,
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com