Landing: 03bf75708509
Project / Subsystem
gcc / c++
Date
2026-05-12
Author
Jason Merrill
Commit
03bf757085091d95a9fe4ab964ee62da157ef563
Source
github
Perf win
No
Breaking
No
All attributes
- project
- gcc
- subsystem
- c++
- patch_id
- —
- commit_hash
- 03bf757085091d95a9fe4ab964ee62da157ef563
- source_type
- github
- headline
- C++: Suppresses -Wzero-as-null-pointer-constant for spaceship operator.
- tldr
- Disables the `-Wzero-as-null-pointer-constant` warning when using the spaceship operator (`<=>`) in the standard way.
- author
- Jason Merrill
- outcome
- committed
- performance_win
- false
- breaking_change
- false
- series_id
- —
- series_parts
- []
- tags
-
- • c++
- • warning
- • spaceship operator
- • code quality
- discussion_id_link
- —
- bugzilla_pr
- —
- date
- 2026-05-12T00:00:00.000Z
The compiler now avoids issuing the -Wzero-as-null-pointer-constant warning when the spaceship operator (<=>) is used in the recommended pattern (x <=> y) < 0. This pattern is used for comparisons and the warning is unnecessary, as the standard library itself uses this pattern. The warning is already suppressed within the <compare> header.