diff options
author | Jason Merrill <jason@redhat.com> | 2020-05-26 17:27:55 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2020-05-27 10:05:57 -0400 |
commit | 6c66c692043d680a5efcd9616b94f9629c417038 (patch) | |
tree | ccf545124706b2d7e2a4103c0361b9fcef648af8 /gcc/fortran/trans-decl.c | |
parent | 7e7d9fcff56385812764cba63e1ebf6f4c6c0320 (diff) | |
download | gcc-6c66c692043d680a5efcd9616b94f9629c417038.zip gcc-6c66c692043d680a5efcd9616b94f9629c417038.tar.gz gcc-6c66c692043d680a5efcd9616b94f9629c417038.tar.bz2 |
c++: operator<=> and -Wzero-as-null-pointer-constant [PR95242]
In C++20, if there is no viable operator< available, lhs < rhs gets
rewritten to (lhs <=> rhs) < 0, where operator< for the comparison
categories is intended to accept literal 0 on the RHS but not other
integers. We don't want this to produce a warning from
-Wzero-as-null-pointer-constant.
gcc/cp/ChangeLog:
* call.c (build_new_op_1): Suppress
warn_zero_as_null_pointer_constant across comparison of <=> result
to 0.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/spaceship-synth2.C: Add
-Wzero-as-null-pointer-constant.
Diffstat (limited to 'gcc/fortran/trans-decl.c')
0 files changed, 0 insertions, 0 deletions