https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86228

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-06-20
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The standard says:

The usual arithmetic conversions (8.3) are performed on operands of arithmetic
or enumeration type. If both operands are pointers, pointer conversions (7.11)
and qualification conversions (7.5) are performed to bring them to their
composite pointer type (8.2). After conversions, the operands shall have the
same type.


Although 0 is a null pointer constant, its type is 'int' not a pointer type, so
I think Clang is right, and this should be ill-formed.

Reply via email to