Re: [PATCH] c++: Implement DR 1512, Pointer comparison vs qual convs [PR87699]

2020-05-18 Thread Marek Polacek via Gcc-patches
On Mon, May 18, 2020 at 03:50:55PM -0400, Jason Merrill via Gcc-patches wrote: > On 5/16/20 6:32 PM, Marek Polacek wrote: > > + const int q1 = cp_type_quals (pointee1); > > + const int q2 = cp_type_quals (pointee2); > > + const int quals = q1 | q2; > > result_type = cp_build_qualified_type (

Re: [PATCH] c++: Implement DR 1512, Pointer comparison vs qual convs [PR87699]

2020-05-18 Thread Jason Merrill via Gcc-patches
On 5/16/20 6:32 PM, Marek Polacek wrote: + const int q1 = cp_type_quals (pointee1); + const int q2 = cp_type_quals (pointee2); + const int quals = q1 | q2; result_type = cp_build_qualified_type (result_type, -(cp_type_quals (pointee1) -

[PATCH] c++: Implement DR 1512, Pointer comparison vs qual convs [PR87699]

2020-05-16 Thread Marek Polacek via Gcc-patches
This patch resolves DR 1512 (and, by turn, DR 583). This entails: 1) Relational pointer comparisons against null pointer constants have been made ill-formed: void f(char *p) { if (p > 0) // ... } was always invalid in C but was -- accidentally -- allowed in C++. 2) Th