2021-03-23 20:38:55 +08:00
|
|
|
// RUN: %clang_analyze_cc1 -std=c++20 -w -analyzer-checker=core -verify %s
|
|
|
|
|
|
|
|
// expected-no-diagnostics
|
|
|
|
|
|
|
|
namespace std {
|
|
|
|
struct strong_ordering {
|
|
|
|
int n;
|
|
|
|
constexpr operator int() const { return n; }
|
|
|
|
static const strong_ordering equal, greater, less;
|
|
|
|
};
|
|
|
|
constexpr strong_ordering strong_ordering::equal = {0};
|
|
|
|
constexpr strong_ordering strong_ordering::greater = {1};
|
|
|
|
constexpr strong_ordering strong_ordering::less = {-1};
|
|
|
|
} // namespace std
|
|
|
|
|
|
|
|
void test() {
|
2021-08-11 00:19:27 +08:00
|
|
|
// no crash
|
2021-03-23 20:38:55 +08:00
|
|
|
(void)(0 <=> 0);
|
|
|
|
}
|