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

--- Comment #3 from Cameron <dacamara.cameron at gmail dot com> ---
(In reply to W E Brown from comment #2)
> Please note that the submitted test program seems not to meet the #include
> requirement as articulated in N4835 clause [expr.spaceship] p10:
> 
> "10 The five comparison category types (17.11.2) (the types
> std::strong_ordering, std::strong_equality, std::weak_ordering,
> std::weak_equality, and std::partial_ordering) are not predefined; if the
> header <compare> (17.11.1) is not included prior to a use of such a class
> type – even an implicit use in which the type is not named (e.g., via the
> auto specifier (9.2.8.5) in a defaulted three-way comparison (11.11.3) or
> use of the built-in operator) – the program is ill-formed."

My mistake, I over simplified the example.  There should have been a #include
<compare> in both cases.

Reply via email to