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

2024-01-09 Thread Jakub Jelinek
On Tue, Jan 09, 2024 at 11:20:02AM +0300, Dmitry Drozodv wrote: > diff --git a/gcc/cp/cvt.cc b/gcc/cp/cvt.cc > index cbed847b343..14462356a0e 100644 > --- a/gcc/cp/cvt.cc > +++ b/gcc/cp/cvt.cc > @@ -218,8 +218,9 @@ cp_convert_to_pointer (tree type, tree expr, bool > dofold, > ? bu

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

2024-01-09 Thread Dmitry Drozodv
According C++ standard [conv.lval]p3.1: If T is cv std::nullptr_t, the result is a null pointer constant. [Note: Since the conversion does not access the object to which the glvalue refers, there is no side effect even if T is volatile-qualified, and the glvalue can refer to an inactive member of a