On Thu, 2 Dec 2021, Alejandro Colomar (man-pages) via Gcc wrote: > So, now this can be made non-flow-sensitive, which was a big concern. And now > the biggest concern I can see is that this qualifier works opposite to const > (here discarding is allowed but not adding it), and that is contrary to how
For all existing qualifiers, the rules about discarding are rules about permitted assignments (and conversions as if by assignment) between pointers and concern the qualifiers on pointer target types: 6.5.16.1 is the key subclause concerning implicit conversions, and any proposal for changes in that area needs to be precise about exactly what textual changes are proposed to 6.5.16.1. > compilers have been working for now. As far as I could read in the standard, > there's no mention to qualifiers being dropped in an rvalue; Joseph, could you > please confirm? Also, as I already mentioned, Clang already implements this lvalue-to-rvalue conversion drops qualifiers (and _Atomic). "If the lvalue has qualified type, the value has the unqualified version of the type of the lvalue; additionally, if the lvalue has atomic type, the value has the non-atomic version of the type of the lvalue; otherwise, the value has the type of the lvalue." (6.3.2.1). -- Joseph S. Myers jos...@codesourcery.com