Re: [PATCH v2] c++: side effect in nullptr_t conversion fix

2024-01-18 Thread Dmitry Drozodv
[PATCH v3] c++: side effect in nullptr_t conversion fix Hi, > This seems to assume that a CONVERT_EXPR can't have any other > side-effects nested in it. > > It seems to me a better approach is the one in keep_unused_object_arg > and cp_gimplify_expr, basically > > if (TREE_THIS_VOLATILE (e)) >

Re: [PATCH v2] c++: side effect in nullptr_t conversion fix

2024-01-16 Thread Jason Merrill
On 1/11/24 15:34, Dmitry Drozodv wrote: You are absolutely right, we can't throw all side-effects away. + /* C++ [conv.lval]p3: +If T is cv std::nullptr_t, the result is a null pointer constant. */ + return ((TREE_SIDE_EFFECTS (expr) && !CONVERT_EXPR_P (expr)) + ?