Skip to content

__cpp_lib_three_way_comparison not defined when it should be #73953

Closed
@QrczakMK

Description

@QrczakMK

https://godbolt.org/z/z67c5EErb

The following code fails the #error with -std=c++20 -stdlib=libc++:

#include <compare>
#include <version>

std::strong_ordering Test(int a, int b) {
  return a <=> b;
}

#if defined(__cpp_impl_three_way_comparison) && \
    !defined(__cpp_lib_three_way_comparison)
#error The library supports three-way comparison but claims it does not
#endif

Metadata

Metadata

Assignees

Labels

c++20libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions