Path: csiph.com!weretis.net!feeder8.news.weretis.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c++ Subject: Re: `bool` in pointer arithmetic: when does the promotion occur, if ever? Date: Sun, 02 Oct 2022 12:37:46 -0700 Organization: A noiseless patient Spider Lines: 14 Message-ID: <86czbaj9th.fsf@linuxsc.com> References: <868rmkn2k7.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader01.eternal-september.org; posting-host="ebe72c05e9167e1dd1c2f9bc3baee014"; logging-data="1901219"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18tZFaCkTWhCYlkdIZbTP8GQbiIneEaqcQ=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:Jxd7b/BPY21PDq32wW9VlXyRBCk= sha1:8eiwR+6chlKHAxt1kkUnUQRDGZw= Xref: csiph.com comp.lang.c++:86764 Language Lawyer writes: >> Section 7.4 is written with the assumption that there will be two >> operands being treated, but in this case there is only one. Thus a >> solution is to revise 7.4 so it addresses the more general scenario >> of converting one or more operands. > > Or explicitly say in [expr.add] that the promotion is performed on > the integer or enumeration operand, Seems like a bandaid. I think it would be better to add a case to the usual arithmetic conversions that covers the case of a pointer and a non-pointer.