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 (
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)
-
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