On 11/07/2011 11:33 AM, Torvald Riegel wrote:
> Fix instantiation of transaction expressions.
>
> * cp/pt.c (tsubst_expr) [TRANSACTION_EXPR]: If body is not a
> statement, create an expression instead.
> * cp/cp-tree.h (TRANSACTION_EXPR_IS_STMT, build_transaction_expr): N
On Mon, 2011-11-07 at 14:04 -0500, Jason Merrill wrote:
> On 11/07/2011 11:31 AM, Richard Henderson wrote:
> > On 11/07/2011 06:12 AM, Torvald Riegel wrote:
> >> stmt = begin_transaction_stmt (input_location, NULL, flags);
> >> tmp = RECUR (TRANSACTION_EXPR_BODY (t));
> >> +
On 11/07/2011 11:31 AM, Richard Henderson wrote:
On 11/07/2011 06:12 AM, Torvald Riegel wrote:
stmt = begin_transaction_stmt (input_location, NULL, flags);
tmp = RECUR (TRANSACTION_EXPR_BODY (t));
+if (tmp)
+ {
+/* No statements; handle this like
On 11/07/2011 06:12 AM, Torvald Riegel wrote:
> stmt = begin_transaction_stmt (input_location, NULL, flags);
> tmp = RECUR (TRANSACTION_EXPR_BODY (t));
> +if (tmp)
> + {
> +/* No statements; handle this like an expression. */
In which case I'm pretty
I stumbled upon this when working on noexcept. When txn expressions were
processed in tsubst_expr(), the previous code incorrectly created empty
transaction statements because no statements got added to the statement
list used by (begin|finish)_transaction_stmt(). Also,
"return __transaction_atomic