From 4eb24e010993b2d9152c2038566f0114fd65fac7 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 14 Jun 2016 16:18:34 -0400 Subject: P0145R2: Refining Expression Order for C++. gcc/c-family/ * c.opt (fargs-in-order): New. * c-opts.c (c_common_post_options): Adjust flag_args_in_order. gcc/cp/ * cp-tree.h (CALL_EXPR_OPERATOR_SYNTAX, CALL_EXPR_ORDERED_ARGS) (CALL_EXPR_REVERSE_ARGS): New. * call.c (build_new_op_1): Set them. (extract_call_expr, op_is_ordered): New. (build_over_call): Set CALL_EXPR_ORDERED_ARGS. * cp-gimplify.c (cp_gimplify_expr) [CALL_EXPR]: Handle new flags. * pt.c (tsubst_copy_and_build): Copy new flags. * semantics.c (simplify_aggr_init_expr): Likewise. * tree.c (build_aggr_init_expr): Likewise. (build_min_non_dep_op_overload): Likewise. From-SVN: r237459 --- gcc/doc/invoke.texi | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gcc/doc') diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 223fd86..2105351 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -189,7 +189,8 @@ in the following sections. @item C++ Language Options @xref{C++ Dialect Options,,Options Controlling C++ Dialect}. -@gccoptlist{-fabi-version=@var{n} -fno-access-control -fcheck-new @gol +@gccoptlist{-fabi-version=@var{n} -fno-access-control @gol +-fargs-in-order=@var{n} -fcheck-new @gol -fconstexpr-depth=@var{n} -ffriend-injection @gol -fno-elide-constructors @gol -fno-enforce-eh-specs @gol @@ -2233,6 +2234,14 @@ option is used for the warning. Turn off all access checking. This switch is mainly useful for working around bugs in the access control code. +@item -fargs-in-order +@opindex fargs-in-order +Evaluate function arguments and operands of some binary expressions in +left-to-right order, and evaluate the right side of an assignment +before the left side, as proposed in P0145R2. Enabled by default with +@option{-std=c++1z}. @option{-fargs-in-order=1} implements all of the +ordering requirements except function arguments. + @item -fcheck-new @opindex fcheck-new Check that the pointer returned by @code{operator new} is non-null -- cgit v1.1